Merge remote-tracking branch 'origin/pr/1091'

* origin/pr/1091:
  Escape plus sign (fixes #1090)
This commit is contained in:
Jakob Borg 2014-12-07 08:05:21 +01:00
commit 996cbbca38
3 changed files with 4 additions and 0 deletions

View File

@ -55,6 +55,7 @@ func Convert(pattern string, flags int) (*regexp.Regexp, error) {
pattern = strings.Replace(pattern, "\\.", "[:escapeddot:]", -1)
}
pattern = strings.Replace(pattern, ".", "\\.", -1)
pattern = strings.Replace(pattern, "+", "\\+", -1)
pattern = strings.Replace(pattern, "**", "[:doublestar:]", -1)
pattern = strings.Replace(pattern, "*", any+"*", -1)
pattern = strings.Replace(pattern, "[:doublestar:]", ".*", -1)

View File

@ -55,6 +55,8 @@ func TestIgnore(t *testing.T) {
{filepath.Join("dir3"), true},
{filepath.Join("dir3", "afile"), true},
{"lost+found", true},
}
for i, tc := range tests {

View File

@ -4,3 +4,4 @@ bfile
dir1/cfile
**/efile
/ffile
lost+found