filter: fix bug, copy slice with new pattern

This commit is contained in:
Alexander Neumann committed 2015-07-20 19:21:01 +02:00
1 parent e9285539be
commit b425ea19e5
2 files changed
+23 -2

No files matched your search

+2 -1
View File
@@ -45,7 +45,8 @@ func match(patterns, strs []string) (matched bool, err error) {
if ok, pos := hasDoubleWildcard(patterns); ok {
// gradually expand '**' into separate wildcards
for i := 0; i <= len(strs)-len(patterns)+1; i++ {
newPat := patterns[:pos]
newPat := make([]string, pos)
copy(newPat, patterns[:pos])
for k := 0; k < i; k++ {
newPat = append(newPat, "*")
}