1
0
mirror of https://github.com/golang/go synced 2024-11-21 21:44:40 -07:00

go/build: evaluate symlinks before comparing path to GOPATH

R=golang-dev, r, dsymonds
CC=golang-dev
https://golang.org/cl/4645078
This commit is contained in:
Andrew Gerrand 2011-07-04 10:26:03 +10:00
parent 3cd8f27d79
commit 8c7a73bbbb

View 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) {