diff options
Diffstat (limited to 'libgo/go/path/filepath/match.go')
-rw-r--r-- | libgo/go/path/filepath/match.go | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/libgo/go/path/filepath/match.go b/libgo/go/path/filepath/match.go index a05bb5f7e71..7fcc214c058 100644 --- a/libgo/go/path/filepath/match.go +++ b/libgo/go/path/filepath/match.go @@ -124,9 +124,8 @@ func matchChunk(chunk, s string) (rest string, ok bool, err os.Error) { s = s[n:] chunk = chunk[1:] // possibly negated - notNegated := true - if len(chunk) > 0 && chunk[0] == '^' { - notNegated = false + negated := chunk[0] == '^' + if negated { chunk = chunk[1:] } // parse all ranges @@ -152,7 +151,7 @@ func matchChunk(chunk, s string) (rest string, ok bool, err os.Error) { } nrange++ } - if match != notNegated { + if match == negated { return } @@ -273,7 +272,7 @@ func glob(dir, pattern string, matches []string) (m []string, e os.Error) { if err != nil { return } - sort.SortStrings(names) + sort.Strings(names) for _, n := range names { matched, err := Match(pattern, n) |