Index: libgo/go/path/match.go |
=================================================================== |
--- a/libgo/go/path/match.go |
+++ b/libgo/go/path/match.go |
@@ -240,9 +240,13 @@ |
// glob searches for files matching pattern in the directory dir |
// and appends them to matches. |
func glob(dir, pattern string, matches []string) []string { |
- if fi, err := os.Stat(dir); err != nil || !fi.IsDirectory() { |
+ fi, err := os.Stat(dir) |
+ if err != nil { |
return nil |
} |
+ if !fi.IsDirectory() { |
+ return matches |
+ } |
d, err := os.Open(dir, os.O_RDONLY, 0666) |
if err != nil { |
return nil |