summaryrefslogtreecommitdiff
path: root/src/fnmatch.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/fnmatch.c')
-rw-r--r--src/fnmatch.c4
1 files changed, 3 insertions, 1 deletions
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 == '*')