mirror of
https://github.com/octoleo/syncthing.git
synced 2024-11-09 23:00:58 +00:00
Escape plus sign (fixes #1090)
This commit is contained in:
parent
3e7b197a1d
commit
88a347dce0
@ -55,6 +55,7 @@ func Convert(pattern string, flags int) (*regexp.Regexp, error) {
|
|||||||
pattern = strings.Replace(pattern, "\\.", "[:escapeddot:]", -1)
|
pattern = strings.Replace(pattern, "\\.", "[:escapeddot:]", -1)
|
||||||
}
|
}
|
||||||
pattern = strings.Replace(pattern, ".", "\\.", -1)
|
pattern = strings.Replace(pattern, ".", "\\.", -1)
|
||||||
|
pattern = strings.Replace(pattern, "+", "\\+", -1)
|
||||||
pattern = strings.Replace(pattern, "**", "[:doublestar:]", -1)
|
pattern = strings.Replace(pattern, "**", "[:doublestar:]", -1)
|
||||||
pattern = strings.Replace(pattern, "*", any+"*", -1)
|
pattern = strings.Replace(pattern, "*", any+"*", -1)
|
||||||
pattern = strings.Replace(pattern, "[:doublestar:]", ".*", -1)
|
pattern = strings.Replace(pattern, "[:doublestar:]", ".*", -1)
|
||||||
|
@ -55,6 +55,8 @@ func TestIgnore(t *testing.T) {
|
|||||||
|
|
||||||
{filepath.Join("dir3"), true},
|
{filepath.Join("dir3"), true},
|
||||||
{filepath.Join("dir3", "afile"), true},
|
{filepath.Join("dir3", "afile"), true},
|
||||||
|
|
||||||
|
{"lost+found", true},
|
||||||
}
|
}
|
||||||
|
|
||||||
for i, tc := range tests {
|
for i, tc := range tests {
|
||||||
|
1
internal/ignore/testdata/.stignore
vendored
1
internal/ignore/testdata/.stignore
vendored
@ -4,3 +4,4 @@ bfile
|
|||||||
dir1/cfile
|
dir1/cfile
|
||||||
**/efile
|
**/efile
|
||||||
/ffile
|
/ffile
|
||||||
|
lost+found
|
||||||
|
Loading…
Reference in New Issue
Block a user