diff options
Diffstat (limited to 'libgo/go/path/filepath/symlink.go')
-rw-r--r-- | libgo/go/path/filepath/symlink.go | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/libgo/go/path/filepath/symlink.go b/libgo/go/path/filepath/symlink.go index bc287c5ecb..824aee4e49 100644 --- a/libgo/go/path/filepath/symlink.go +++ b/libgo/go/path/filepath/symlink.go @@ -100,13 +100,14 @@ func walkSymlinks(path string) (string, error) { return "", err } if runtime.GOOS == "windows" { - // walkLinks(".", ...) always retuns "." on unix. + // walkLinks(".", ...) always returns "." on unix. // But on windows it returns symlink target, if current // directory is a symlink. Stop the walk, if symlink // target is not absolute path, and return "." // to the caller (just like unix does). - if path == "." && !IsAbs(newpath) { - return ".", nil + // Same for "C:.". + if path[volumeNameLen(path):] == "." && !IsAbs(newpath) { + return path, nil } } if i == linksWalked { |