summaryrefslogtreecommitdiff
path: root/libgo/go/path/filepath
diff options
context:
space:
mode:
Diffstat (limited to 'libgo/go/path/filepath')
-rw-r--r--libgo/go/path/filepath/example_unix_test.go1
-rw-r--r--libgo/go/path/filepath/example_unix_walk_test.go1
-rw-r--r--libgo/go/path/filepath/path_test.go2
-rw-r--r--libgo/go/path/filepath/path_unix.go1
-rw-r--r--libgo/go/path/filepath/path_windows.go4
-rw-r--r--libgo/go/path/filepath/symlink_unix.go1
6 files changed, 6 insertions, 4 deletions
diff --git a/libgo/go/path/filepath/example_unix_test.go b/libgo/go/path/filepath/example_unix_test.go
index 4ce10095e67..b364cf0608d 100644
--- a/libgo/go/path/filepath/example_unix_test.go
+++ b/libgo/go/path/filepath/example_unix_test.go
@@ -3,7 +3,6 @@
// license that can be found in the LICENSE file.
//go:build !windows && !plan9
-// +build !windows,!plan9
package filepath_test
diff --git a/libgo/go/path/filepath/example_unix_walk_test.go b/libgo/go/path/filepath/example_unix_walk_test.go
index d72efcebe61..86146dba5be 100644
--- a/libgo/go/path/filepath/example_unix_walk_test.go
+++ b/libgo/go/path/filepath/example_unix_walk_test.go
@@ -3,7 +3,6 @@
// license that can be found in the LICENSE file.
//go:build !windows && !plan9
-// +build !windows,!plan9
package filepath_test
diff --git a/libgo/go/path/filepath/path_test.go b/libgo/go/path/filepath/path_test.go
index 1be17df0466..85926eadf11 100644
--- a/libgo/go/path/filepath/path_test.go
+++ b/libgo/go/path/filepath/path_test.go
@@ -794,6 +794,8 @@ var winisabstests = []IsAbsTest{
{`c:a\b`, false},
{`c:\a\b`, true},
{`c:/a/b`, true},
+ {`\\host\share`, true},
+ {`\\host\share\`, true},
{`\\host\share\foo`, true},
{`//host/share/foo/bar`, true},
}
diff --git a/libgo/go/path/filepath/path_unix.go b/libgo/go/path/filepath/path_unix.go
index b0a63914c1d..88d7325b1a1 100644
--- a/libgo/go/path/filepath/path_unix.go
+++ b/libgo/go/path/filepath/path_unix.go
@@ -3,7 +3,6 @@
// license that can be found in the LICENSE file.
//go:build aix || darwin || dragonfly || freebsd || hurd || (js && wasm) || linux || netbsd || openbsd || solaris
-// +build aix darwin dragonfly freebsd hurd js,wasm linux netbsd openbsd solaris
package filepath
diff --git a/libgo/go/path/filepath/path_windows.go b/libgo/go/path/filepath/path_windows.go
index 445c868e414..b4d8ac33010 100644
--- a/libgo/go/path/filepath/path_windows.go
+++ b/libgo/go/path/filepath/path_windows.go
@@ -45,6 +45,10 @@ func IsAbs(path string) (b bool) {
if l == 0 {
return false
}
+ // If the volume name starts with a double slash, this is a UNC path.
+ if isSlash(path[0]) && isSlash(path[1]) {
+ return true
+ }
path = path[l:]
if path == "" {
return false
diff --git a/libgo/go/path/filepath/symlink_unix.go b/libgo/go/path/filepath/symlink_unix.go
index 657945a81a3..7bfe17e2fd1 100644
--- a/libgo/go/path/filepath/symlink_unix.go
+++ b/libgo/go/path/filepath/symlink_unix.go
@@ -1,5 +1,4 @@
//go:build !windows
-// +build !windows
package filepath