diff options
| author | Russ Cox <rsc@golang.org> | 2016-10-19 00:01:31 -0400 |
|---|---|---|
| committer | Russ Cox <rsc@golang.org> | 2016-10-24 16:24:20 +0000 |
| commit | 452bbfc179d6739a404aacc819ec66acc71fc55c (patch) | |
| tree | bf4ce233f6c731f3942a44cdbe321b1c61bf1328 /src/path/filepath/path_windows.go | |
| parent | c5ccbdd22bdbdc43d541b7e7d4ed66ceb559030e (diff) | |
| download | go-452bbfc179d6739a404aacc819ec66acc71fc55c.tar.xz | |
path/filepath: fix match of \\?\c:\* on Windows
\\?\c:\ is a "root directory" that is not subject to further matching,
but the ? makes it look like a pattern, which was causing an
infinite recursion. Make sure the code understands the ? is not a pattern.
Fixes #15879.
Change-Id: I3a4310bbc398bcae764b9f8859c875317345e757
Reviewed-on: https://go-review.googlesource.com/31460
Reviewed-by: Quentin Smith <quentin@golang.org>
Diffstat (limited to 'src/path/filepath/path_windows.go')
| -rw-r--r-- | src/path/filepath/path_windows.go | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/path/filepath/path_windows.go b/src/path/filepath/path_windows.go index 41c57df738..a74b6469a9 100644 --- a/src/path/filepath/path_windows.go +++ b/src/path/filepath/path_windows.go @@ -37,7 +37,7 @@ func volumeNameLen(path string) int { if path[1] == ':' && ('a' <= c && c <= 'z' || 'A' <= c && c <= 'Z') { return 2 } - // is it UNC + // is it UNC? https://msdn.microsoft.com/en-us/library/windows/desktop/aa365247(v=vs.85).aspx if l := len(path); l >= 5 && isSlash(path[0]) && isSlash(path[1]) && !isSlash(path[2]) && path[2] != '.' { // first, leading `\\` and next shouldn't be `\`. its server name. |
