aboutsummaryrefslogtreecommitdiff
path: root/src/path/filepath/path_windows_test.go
diff options
context:
space:
mode:
authorRuss Cox <rsc@golang.org>2016-10-19 00:01:31 -0400
committerRuss Cox <rsc@golang.org>2016-10-24 16:24:20 +0000
commit452bbfc179d6739a404aacc819ec66acc71fc55c (patch)
treebf4ce233f6c731f3942a44cdbe321b1c61bf1328 /src/path/filepath/path_windows_test.go
parentc5ccbdd22bdbdc43d541b7e7d4ed66ceb559030e (diff)
downloadgo-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_test.go')
-rw-r--r--src/path/filepath/path_windows_test.go8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/path/filepath/path_windows_test.go b/src/path/filepath/path_windows_test.go
index 8d552d06f7..6393629ccc 100644
--- a/src/path/filepath/path_windows_test.go
+++ b/src/path/filepath/path_windows_test.go
@@ -12,6 +12,7 @@ import (
"os/exec"
"path/filepath"
"reflect"
+ "runtime/debug"
"strings"
"testing"
)
@@ -413,3 +414,10 @@ func TestToNorm(t *testing.T) {
}
}
}
+
+func TestUNC(t *testing.T) {
+ // Test that this doesn't go into an infinite recursion.
+ // See golang.org/issue/15879.
+ defer debug.SetMaxStack(debug.SetMaxStack(1e6))
+ filepath.Glob(`\\?\c:\*`)
+}