]> Cypherpunks repositories - gostls13.git/commit
Revert "path/filepath: change IsAbs("NUL") to return true"
authorDamien Neil <dneil@google.com>
Tue, 8 Nov 2022 22:21:30 +0000 (14:21 -0800)
committerDamien Neil <dneil@google.com>
Wed, 9 Nov 2022 22:06:26 +0000 (22:06 +0000)
commit739618945ef271793d608b587694ca1df353951d
tree21d7e0bbe39635a1142941fad678ca75abe8385c
parent61c57575cd01940d06a327ce61b8923bf4a7553a
Revert "path/filepath: change IsAbs("NUL") to return true"

This reverts commit d154ef60a0c88be98c70bbe1c5735fb7b1f45250.

This change made IsAbs return true for certain reserved filenames,
but does not consistently detect reserved names. For example,
"./COM1", "//./COM1", and (on some Windows versions) "COM1.txt"
all refer to the COM1 device, but IsAbs detects none of them.

Since NUL is not an absolute path, do not attempt to detect it
or other device paths in IsAbs. See #56217 for more discussion
of IsAbs and device paths.

For #56217.

Change-Id: If4bf81c7e1a2e8842206c7c5268555102140dae8
Reviewed-on: https://go-review.googlesource.com/c/go/+/448898
Reviewed-by: Michael Knyszek <mknyszek@google.com>
Run-TryBot: Damien Neil <dneil@google.com>
Reviewed-by: Quim Muntal <quimmuntal@gmail.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Rob Pike <r@golang.org>
src/path/filepath/path_test.go
src/path/filepath/path_windows.go