From 5342aedeed54606fa1dcad2f039744fabfcc7544 Mon Sep 17 00:00:00 2001 From: Alex Brainman Date: Tue, 17 May 2011 12:33:36 +1000 Subject: filepath: make EvalSymlinks work on Windows Fixes #1830. R=golang-dev, rsc CC=golang-dev https://golang.org/cl/4526060 --- src/pkg/path/filepath/path.go | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'src/pkg/path/filepath/path.go') diff --git a/src/pkg/path/filepath/path.go b/src/pkg/path/filepath/path.go index 541a233066..6917218dbe 100644 --- a/src/pkg/path/filepath/path.go +++ b/src/pkg/path/filepath/path.go @@ -9,6 +9,7 @@ package filepath import ( "bytes" "os" + "runtime" "sort" "strings" ) @@ -178,6 +179,14 @@ func Ext(path string) string { // links. // If path is relative it will be evaluated relative to the current directory. func EvalSymlinks(path string) (string, os.Error) { + if runtime.GOOS == "windows" { + // Symlinks are not supported under windows. + _, err := os.Lstat(path) + if err != nil { + return "", err + } + return Clean(path), nil + } const maxIter = 255 originalPath := path // consume path by taking each frontmost path element, -- cgit v1.3-5-g9baa