]> Cypherpunks repositories - gostls13.git/commitdiff
go/build: evaluate symlinks before comparing path to GOPATH
authorAndrew Gerrand <adg@golang.org>
Mon, 4 Jul 2011 00:26:03 +0000 (10:26 +1000)
committerAndrew Gerrand <adg@golang.org>
Mon, 4 Jul 2011 00:26:03 +0000 (10:26 +1000)
R=golang-dev, r, dsymonds
CC=golang-dev
https://golang.org/cl/4645078

src/pkg/go/build/path.go

index 8ad39fb0f2bd506ba6ff1c2354eca362c02f1ddf..ea588abbd6b55380d8ed4974f20f44fdac5c4af7 100644 (file)
@@ -88,6 +88,9 @@ func FindTree(path string) (tree *Tree, pkg string, err os.Error) {
                if path, err = filepath.Abs(path); err != nil {
                        return
                }
+               if path, err = filepath.EvalSymlinks(path); err != nil {
+                       return
+               }
                for _, t := range Path {
                        tpath := t.SrcDir() + string(filepath.Separator)
                        if !strings.HasPrefix(path, tpath) {