Merge remote-tracking branch 'origin/pr/1091'
* origin/pr/1091: Escape plus sign (fixes #1090)
This commit is contained in:
commit
996cbbca38
|
@ -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 {
|
||||||
|
|
|
@ -4,3 +4,4 @@ bfile
|
||||||
dir1/cfile
|
dir1/cfile
|
||||||
**/efile
|
**/efile
|
||||||
/ffile
|
/ffile
|
||||||
|
lost+found
|
||||||
|
|
Loading…
Reference in New Issue