From 8dc2499aa62f768c6395c9754b8cabc1ce25c494 Mon Sep 17 00:00:00 2001 From: Ian Lance Taylor Date: Fri, 11 Feb 2022 14:53:56 -0800 Subject: libgo: update to Go1.18beta2 gotools/ * Makefile.am (go_cmd_cgo_files): Add ast_go118.go (check-go-tool): Copy golang.org/x/tools directories. * Makefile.in: Regenerate. Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/384695 --- libgo/go/path/filepath/example_unix_test.go | 1 - libgo/go/path/filepath/example_unix_walk_test.go | 1 - libgo/go/path/filepath/path_test.go | 2 ++ libgo/go/path/filepath/path_unix.go | 1 - libgo/go/path/filepath/path_windows.go | 4 ++++ libgo/go/path/filepath/symlink_unix.go | 1 - 6 files changed, 6 insertions(+), 4 deletions(-) (limited to 'libgo/go/path') diff --git a/libgo/go/path/filepath/example_unix_test.go b/libgo/go/path/filepath/example_unix_test.go index 4ce1009..b364cf0 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 d72efce..86146db 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 1be17df..85926ea 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 b0a6391..88d7325 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 445c868..b4d8ac3 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 657945a..7bfe17e 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 -- cgit v1.1