diff --git a/src/fnmatch.c b/src/fnmatch.c index 8e5424b75..3846bab3c 100644 --- a/src/fnmatch.c +++ b/src/fnmatch.c @@ -55,7 +55,9 @@ p_fnmatchx(const char *pattern, const char *string, int flags, size_t recurs) case '*': c = *pattern; - /* Apply '**' to overwrite PATHNAME match */ + /* Let '**' override PATHNAME match for this segment. + * It will be restored if/when we recurse below. + */ if (c == '*') { flags &= ~FNM_PATHNAME; while (c == '*')