diff --git a/internal/fnmatch/fnmatch.go b/internal/fnmatch/fnmatch.go index db87e1d13..df19b29d5 100644 --- a/internal/fnmatch/fnmatch.go +++ b/internal/fnmatch/fnmatch.go @@ -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) diff --git a/internal/ignore/ignore_test.go b/internal/ignore/ignore_test.go index dcf153080..8c5624e59 100644 --- a/internal/ignore/ignore_test.go +++ b/internal/ignore/ignore_test.go @@ -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 { diff --git a/internal/ignore/testdata/.stignore b/internal/ignore/testdata/.stignore index 89a11f4b8..b6f4d6655 100644 --- a/internal/ignore/testdata/.stignore +++ b/internal/ignore/testdata/.stignore @@ -4,3 +4,4 @@ bfile dir1/cfile **/efile /ffile +lost+found