summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/regex/fnmatch.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/regex/fnmatch.c b/src/regex/fnmatch.c
index c537ad20..8d73714b 100644
--- a/src/regex/fnmatch.c
+++ b/src/regex/fnmatch.c
@@ -155,7 +155,8 @@ static int match_bracket(const char *p, int k, int kfold)
if (l < 0) return 0;
p += l-1;
}
- if (wc==k || wc==kfold) return !inv;
+ if ((wc==k || wc==kfold) && (p[1]!='-' || p[2]==']'))
+ return !inv;
}
return inv;
}