forked from TrueCloudLab/restic
filter: cleanup path separator conversion
This commit is contained in:
parent
0acc3c5923
commit
8388e67c4b
1 changed files with 2 additions and 10 deletions
|
@ -24,21 +24,13 @@ func prepareStr(str string) ([]string, error) {
|
|||
return nil, ErrBadString
|
||||
}
|
||||
|
||||
// convert file path separator to '/'
|
||||
if filepath.Separator != '/' {
|
||||
str = strings.Replace(str, string(filepath.Separator), "/", -1)
|
||||
}
|
||||
|
||||
str = filepath.ToSlash(str)
|
||||
return strings.Split(str, "/"), nil
|
||||
}
|
||||
|
||||
func preparePattern(pattern string) Pattern {
|
||||
pattern = filepath.Clean(pattern)
|
||||
|
||||
// convert file path separator to '/'
|
||||
if filepath.Separator != '/' {
|
||||
pattern = strings.Replace(pattern, string(filepath.Separator), "/", -1)
|
||||
}
|
||||
pattern = filepath.ToSlash(pattern)
|
||||
|
||||
parts := strings.Split(pattern, "/")
|
||||
patterns := make([]patternPart, len(parts))
|
||||
|
|
Loading…
Reference in a new issue