diff options
author | Ian Lance Taylor <ian@gcc.gnu.org> | 2012-06-25 16:20:03 +0000 |
---|---|---|
committer | Ian Lance Taylor <ian@gcc.gnu.org> | 2012-06-25 16:20:03 +0000 |
commit | 08a680a8879ce9da16d808644730f7cfacaf667f (patch) | |
tree | 5dfe28c3f573ae57b971ed4d9a1c99a76f0a70c4 /libgo/go/path | |
parent | 72de8622ae2d5aaeb58173f454aed87640a989b5 (diff) | |
download | gcc-08a680a8879ce9da16d808644730f7cfacaf667f.tar.gz |
libgo: Update to Go 1.0.2 release.
From-SVN: r188943
Diffstat (limited to 'libgo/go/path')
-rw-r--r-- | libgo/go/path/filepath/path.go | 7 | ||||
-rw-r--r-- | libgo/go/path/filepath/path_plan9.go | 2 | ||||
-rw-r--r-- | libgo/go/path/filepath/path_test.go | 31 |
3 files changed, 37 insertions, 3 deletions
diff --git a/libgo/go/path/filepath/path.go b/libgo/go/path/filepath/path.go index a4e429baec1..815021bd040 100644 --- a/libgo/go/path/filepath/path.go +++ b/libgo/go/path/filepath/path.go @@ -320,8 +320,11 @@ func walk(path string, info os.FileInfo, walkFn WalkFunc) error { } for _, fileInfo := range list { - if err = walk(Join(path, fileInfo.Name()), fileInfo, walkFn); err != nil { - return err + err = walk(Join(path, fileInfo.Name()), fileInfo, walkFn) + if err != nil { + if !fileInfo.IsDir() || err != SkipDir { + return err + } } } return nil diff --git a/libgo/go/path/filepath/path_plan9.go b/libgo/go/path/filepath/path_plan9.go index cf028a75c52..59a5812dd0b 100644 --- a/libgo/go/path/filepath/path_plan9.go +++ b/libgo/go/path/filepath/path_plan9.go @@ -12,7 +12,7 @@ func IsAbs(path string) bool { } // VolumeName returns the leading volume name on Windows. -// It returns "" elsewhere +// It returns "" elsewhere. func VolumeName(path string) string { return "" } diff --git a/libgo/go/path/filepath/path_test.go b/libgo/go/path/filepath/path_test.go index b8766588cf5..097b0d9dc82 100644 --- a/libgo/go/path/filepath/path_test.go +++ b/libgo/go/path/filepath/path_test.go @@ -869,3 +869,34 @@ func TestDriveLetterInEvalSymlinks(t *testing.T) { t.Errorf("Results of EvalSymlinks do not match: %q and %q", flp, fup) } } + +/* This test does not work gccgo, since the sources are arranged + differently. + +func TestBug3486(t *testing.T) { // http://code.google.com/p/go/issues/detail?id=3486 + root, err := filepath.EvalSymlinks(os.Getenv("GOROOT")) + if err != nil { + t.Fatal(err) + } + lib := filepath.Join(root, "lib") + src := filepath.Join(root, "src") + seenSrc := false + filepath.Walk(root, func(pth string, info os.FileInfo, err error) error { + if err != nil { + t.Fatal(err) + } + + switch pth { + case lib: + return filepath.SkipDir + case src: + seenSrc = true + } + return nil + }) + if !seenSrc { + t.Fatalf("%q not seen", src) + } +} + +*/ |