summaryrefslogtreecommitdiff
path: root/regex.c
diff options
context:
space:
mode:
Diffstat (limited to 'regex.c')
-rw-r--r--regex.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/regex.c b/regex.c
index 90f86f46c9..655d2f077e 100644
--- a/regex.c
+++ b/regex.c
@@ -1487,7 +1487,7 @@ re_compile_pattern(pattern, size, bufp)
}
had_char_class = 0;
- if (c == '-')
+ if (c == '-' && p != p0 + 1 && *p != ']')
re_warning("character class has `-' without escape");
if (c == '[' && *p != ':')
re_warning("character class has `[' without escape");