mirror of
https://github.com/restic/restic.git
synced 2026-11-09 00:48:08 +00:00
filter: fix bug, copy slice with new pattern
This commit is contained in:
1 parent
e9285539be
commit
b425ea19e5
2 files changed
+23
-2
No files matched your search
+2
-1
@@ -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, "*")
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user