src/pkg/path/match.go | 6 +++++- diff --git a/src/pkg/path/match.go b/src/pkg/path/match.go index d5cd19fd405ae1c914925fb836f50743381cd0e5..dd3422c4256280b7f66aa698851e8056dec6903e 100644 --- a/src/pkg/path/match.go +++ b/src/pkg/path/match.go @@ -240,8 +240,12 @@ // 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 {