<feed xmlns='http://www.w3.org/2005/Atom'>
<title>go/src/path/filepath/path_test.go, branch json-isValidNumber-before</title>
<subtitle>Fork of Go programming language with my patches.</subtitle>
<id>http://git.kilabit.info/go/atom?h=json-isValidNumber-before</id>
<link rel='self' href='http://git.kilabit.info/go/atom?h=json-isValidNumber-before'/>
<link rel='alternate' type='text/html' href='http://git.kilabit.info/go/'/>
<updated>2023-01-25T16:38:21Z</updated>
<entry>
<title>os: make Lstat for symlinks on Windows consistent with POSIX</title>
<updated>2023-01-25T16:38:21Z</updated>
<author>
<name>Bryan C. Mills</name>
<email>bcmills@google.com</email>
</author>
<published>2023-01-24T14:05:36Z</published>
<link rel='alternate' type='text/html' href='http://git.kilabit.info/go/commit/?id=1d3088effdcb03612dd03eb24feee4aa92070a63'/>
<id>urn:sha1:1d3088effdcb03612dd03eb24feee4aa92070a63</id>
<content type='text'>
This also makes path/filepath.Walk more consistent between
Windows and POSIX platforms.

According to
https://pubs.opengroup.org/onlinepubs/9699919799.2013edition/basedefs/V1_chap04.html#tag_04_12
symlinks in a path that includes a trailing slash must be resolved
before a function acts on that path.

POSIX defines an lstat function, whereas the Win32 API does not, so
Go's os.Lstat should follow the (defined) POSIX semantics instead of
doing something arbitrarily different.

CL 134195 added a test for the correct POSIX behavior when os.Lstat is
called on a symlink. However, the test turned out to be broken on Windows,
and when it was fixed (in CL 143578) it was fixed with different Lstat
behavior on Windows than on all other platforms that support symlinks.

In #50807 we are attempting to provide consistent symlink behavior for
cmd/go. This unnecessary platform difference, if left uncorrected,
will make that fix much more difficult.

CL 460595 reworked the implementation of Stat and Lstat on Windows,
and with the new implementation this fix is straightforward.

For #50807.
Updates #27225.

Change-Id: Ia28821aa4aab6cefa021da2d9b803506cdb2621b
Reviewed-on: https://go-review.googlesource.com/c/go/+/463177
Reviewed-by: Quim Muntal &lt;quimmuntal@gmail.com&gt;
Auto-Submit: Bryan Mills &lt;bcmills@google.com&gt;
TryBot-Result: Gopher Robot &lt;gobot@golang.org&gt;
Reviewed-by: Alex Brainman &lt;alex.brainman@gmail.com&gt;
Reviewed-by: Russ Cox &lt;rsc@golang.org&gt;
Run-TryBot: Bryan Mills &lt;bcmills@google.com&gt;
</content>
</entry>
<entry>
<title>path/filepath: fix evaluation of symlinks to paths under /tmp on macOS</title>
<updated>2023-01-20T22:42:39Z</updated>
<author>
<name>matsuyoshi30</name>
<email>sfbgwm30@gmail.com</email>
</author>
<published>2023-01-18T15:45:18Z</published>
<link rel='alternate' type='text/html' href='http://git.kilabit.info/go/commit/?id=0518e33f6c0c3a9f6ce1f800ca4b7fe5f3a1b7a5'/>
<id>urn:sha1:0518e33f6c0c3a9f6ce1f800ca4b7fe5f3a1b7a5</id>
<content type='text'>
For symlinks created from symlinks under the root directory created
as the relative path (e.g., symbolic links under /tmp), we update vol and volLen.

Fixes #57905

Change-Id: I45affd1db3b93109de51bf19b181f3cdba061109
Reviewed-on: https://go-review.googlesource.com/c/go/+/461761
Run-TryBot: Bryan Mills &lt;bcmills@google.com&gt;
TryBot-Result: Gopher Robot &lt;gobot@golang.org&gt;
Reviewed-by: Bryan Mills &lt;bcmills@google.com&gt;
Auto-Submit: Bryan Mills &lt;bcmills@google.com&gt;
Reviewed-by: Ian Lance Taylor &lt;iant@google.com&gt;
</content>
</entry>
<entry>
<title>path/filepath: make Join("c:", "/a") return "c:/a" again</title>
<updated>2022-12-02T19:48:47Z</updated>
<author>
<name>Damien Neil</name>
<email>dneil@google.com</email>
</author>
<published>2022-11-30T01:07:02Z</published>
<link rel='alternate' type='text/html' href='http://git.kilabit.info/go/commit/?id=79559c1e7e426415ea8c7920c36b2fb4ebd7dbf0'/>
<id>urn:sha1:79559c1e7e426415ea8c7920c36b2fb4ebd7dbf0</id>
<content type='text'>
Historically, on Windows filepath.Join("c:", elt) does not insert
a path separator between "c:" and elt, but preserves leading slashes
in elt. Restore this behavior, which was inadvertently changed by
CL 444280.

Fixes #56988

Change-Id: Id728bf311f4093264f8c067d8b801ea9ebef5b5f
Reviewed-on: https://go-review.googlesource.com/c/go/+/453497
Reviewed-by: Bryan Mills &lt;bcmills@google.com&gt;
TryBot-Result: Gopher Robot &lt;gobot@golang.org&gt;
Auto-Submit: Bryan Mills &lt;bcmills@google.com&gt;
Reviewed-by: Roland Shoemaker &lt;roland@golang.org&gt;
Run-TryBot: Damien Neil &lt;dneil@google.com&gt;
</content>
</entry>
<entry>
<title>path/filepath: detect Windows CONIN$ and CONOUT$ paths in IsLocal</title>
<updated>2022-11-17T18:24:36Z</updated>
<author>
<name>Damien Neil</name>
<email>dneil@google.com</email>
</author>
<published>2022-11-17T18:06:50Z</published>
<link rel='alternate' type='text/html' href='http://git.kilabit.info/go/commit/?id=217ed955887bd59780313bb468862a697b75decd'/>
<id>urn:sha1:217ed955887bd59780313bb468862a697b75decd</id>
<content type='text'>
CreateFile creates a handle to the console input or screen buffer
when opening a file named CONIN$ or CONOUT$:

https://learn.microsoft.com/en-us/windows/win32/api/fileapi/nf-fileapi-createfilea#consoles

Detect these paths as non-local.

For #56219.

Change-Id: Ib09e76a110d6ec09aef8038074b9bcbae09d00d7
Reviewed-on: https://go-review.googlesource.com/c/go/+/451657
Run-TryBot: Damien Neil &lt;dneil@google.com&gt;
TryBot-Result: Gopher Robot &lt;gobot@golang.org&gt;
Reviewed-by: Bryan Mills &lt;bcmills@google.com&gt;
</content>
</entry>
<entry>
<title>path/filepath: remove IsLocal tests dependent on Windows version</title>
<updated>2022-11-17T02:24:38Z</updated>
<author>
<name>Damien Neil</name>
<email>dneil@google.com</email>
</author>
<published>2022-11-17T01:33:03Z</published>
<link rel='alternate' type='text/html' href='http://git.kilabit.info/go/commit/?id=b138e71e5b90c75e6e5239fb8f4536c6dcc31c36'/>
<id>urn:sha1:b138e71e5b90c75e6e5239fb8f4536c6dcc31c36</id>
<content type='text'>
Don't test IsLocal("nul.txt"), since whether this name is reserved
or not is version-dependent.

Change-Id: Ifff3edc77454e052080e325871c08bbba49e692c
Reviewed-on: https://go-review.googlesource.com/c/go/+/451222
Reviewed-by: Austin Clements &lt;austin@google.com&gt;
TryBot-Result: Gopher Robot &lt;gobot@golang.org&gt;
Run-TryBot: Damien Neil &lt;dneil@google.com&gt;
Reviewed-by: Bryan Mills &lt;bcmills@google.com&gt;
</content>
</entry>
<entry>
<title>path/filepath: add IsLocal</title>
<updated>2022-11-16T23:17:58Z</updated>
<author>
<name>Damien Neil</name>
<email>dneil@google.com</email>
</author>
<published>2022-11-10T01:49:44Z</published>
<link rel='alternate' type='text/html' href='http://git.kilabit.info/go/commit/?id=6d0bf438e302afcb0db5422ea2da59d1995e08c1'/>
<id>urn:sha1:6d0bf438e302afcb0db5422ea2da59d1995e08c1</id>
<content type='text'>
IsLocal reports whether a path lexically refers to a location
contained within the directory in which it is evaluated.
It identifies paths that are absolute, escape a directory
with ".." elements, and (on Windows) paths that reference
reserved device names.

For #56219.

Change-Id: I35edfa3ce77b40b8e66f1fc8e0ff73cfd06f2313
Reviewed-on: https://go-review.googlesource.com/c/go/+/449239
Run-TryBot: Damien Neil &lt;dneil@google.com&gt;
Reviewed-by: Joseph Tsai &lt;joetsai@digital-static.net&gt;
TryBot-Result: Gopher Robot &lt;gobot@golang.org&gt;
Reviewed-by: Ian Lance Taylor &lt;iant@google.com&gt;
Reviewed-by: Ian Lance Taylor &lt;iant@golang.org&gt;
Reviewed-by: Joedian Reid &lt;joedian@golang.org&gt;
</content>
</entry>
<entry>
<title>Revert "path/filepath: change IsAbs("NUL") to return true"</title>
<updated>2022-11-09T22:06:26Z</updated>
<author>
<name>Damien Neil</name>
<email>dneil@google.com</email>
</author>
<published>2022-11-08T22:21:30Z</published>
<link rel='alternate' type='text/html' href='http://git.kilabit.info/go/commit/?id=739618945ef271793d608b587694ca1df353951d'/>
<id>urn:sha1:739618945ef271793d608b587694ca1df353951d</id>
<content type='text'>
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 &lt;mknyszek@google.com&gt;
Run-TryBot: Damien Neil &lt;dneil@google.com&gt;
Reviewed-by: Quim Muntal &lt;quimmuntal@gmail.com&gt;
TryBot-Result: Gopher Robot &lt;gobot@golang.org&gt;
Reviewed-by: Rob Pike &lt;r@golang.org&gt;
</content>
</entry>
<entry>
<title>path/filepath: detect all forms of \\ volume paths on Windows</title>
<updated>2022-11-09T22:06:00Z</updated>
<author>
<name>Damien Neil</name>
<email>dneil@google.com</email>
</author>
<published>2022-10-19T21:41:03Z</published>
<link rel='alternate' type='text/html' href='http://git.kilabit.info/go/commit/?id=be9d78c9c5905fbc10d8cd6a4714dd4ad1c91674'/>
<id>urn:sha1:be9d78c9c5905fbc10d8cd6a4714dd4ad1c91674</id>
<content type='text'>
Previously, the volumeNameLen function checked for UNC paths starting
with two slashes, a non-'.' character, and another slash. This misses
volume names such as "\\.\C:\".

The previous check for volume names rejects paths beginning
with "\\.". This is incorrect, because while these names are not
UNC paths, "\\.\C:\" is a DOS device path prefix indicating the
C: device. It also misses UNC path prefixes in the form
"\\.\UNC\server\share\".

The previous check for UNC paths also rejects any path with an
empty or missing host or share component. This leads to a number
of possibly-incorrect behaviors, such as Clean(`\\a`) returning `\a`.
Converting the semantically-significant `\\` prefix to a single `\`
seems wrong.

Consistently treat paths beginning with two separators as having
a volume prefix.

Update VolumeName to detect DOS device paths (`\\.\` or `\\?\`),
DOS device paths linking to UNC paths (`\\.\UNC\Server\Share`
or `\\?\UNC\Server\Share`), and UNC paths (`\\Server\Share\`).

	Clean(`\\a`) = `\\a`
	Join(`\\`, `a`, `b`) = `\\a\b`

In addition, normalize path separators in VolumeName for consistency
with other functions which Clean their result.

Fixes #56336

Change-Id: Id01c33029585bfffc313dcf0ad42ff6ac7ce42fd
Reviewed-on: https://go-review.googlesource.com/c/go/+/444280
Run-TryBot: Damien Neil &lt;dneil@google.com&gt;
Reviewed-by: Quim Muntal &lt;quimmuntal@gmail.com&gt;
TryBot-Result: Gopher Robot &lt;gobot@golang.org&gt;
Reviewed-by: Roland Shoemaker &lt;roland@golang.org&gt;
</content>
</entry>
<entry>
<title>path/filepath, io/fs: add SkipAll</title>
<updated>2022-08-25T18:50:37Z</updated>
<author>
<name>Paschalis Tsilias</name>
<email>paschalis.tsilias@gmail.com</email>
</author>
<published>2021-11-13T00:18:30Z</published>
<link rel='alternate' type='text/html' href='http://git.kilabit.info/go/commit/?id=95a786da1265d84290c1a0d1186352f71475ff9f'/>
<id>urn:sha1:95a786da1265d84290c1a0d1186352f71475ff9f</id>
<content type='text'>
Fixes #47209

Change-Id: If75b0dd38f2c30a23517205d80c7a6683a5c921c
Reviewed-on: https://go-review.googlesource.com/c/go/+/363814
TryBot-Result: Gopher Robot &lt;gobot@golang.org&gt;
Reviewed-by: Ian Lance Taylor &lt;iant@google.com&gt;
Auto-Submit: Ian Lance Taylor &lt;iant@google.com&gt;
Reviewed-by: Daniel Martí &lt;mvdan@mvdan.cc&gt;
Run-TryBot: Daniel Martí &lt;mvdan@mvdan.cc&gt;
Reviewed-by: Bryan Mills &lt;bcmills@google.com&gt;
</content>
</entry>
<entry>
<title>path/filepath: do not remove prefix "." when following path contains ":".</title>
<updated>2022-05-24T21:52:14Z</updated>
<author>
<name>Yasuhiro Matsumoto</name>
<email>mattn.jp@gmail.com</email>
</author>
<published>2022-04-22T01:07:51Z</published>
<link rel='alternate' type='text/html' href='http://git.kilabit.info/go/commit/?id=9cd1818a7d019c02fa4898b3e45a323e35033290'/>
<id>urn:sha1:9cd1818a7d019c02fa4898b3e45a323e35033290</id>
<content type='text'>
Fixes #52476

Change-Id: I9eb72ac7dbccd6322d060291f31831dc389eb9bb
Reviewed-on: https://go-review.googlesource.com/c/go/+/401595
Auto-Submit: Ian Lance Taylor &lt;iant@google.com&gt;
Reviewed-by: Alex Brainman &lt;alex.brainman@gmail.com&gt;
Run-TryBot: Ian Lance Taylor &lt;iant@google.com&gt;
Reviewed-by: Ian Lance Taylor &lt;iant@google.com&gt;
Reviewed-by: Damien Neil &lt;dneil@google.com&gt;
TryBot-Result: Gopher Robot &lt;gobot@golang.org&gt;
</content>
</entry>
</feed>
