aboutsummaryrefslogtreecommitdiffstats
path: root/re.c
diff options
context:
space:
mode:
Diffstat (limited to 're.c')
-rw-r--r--re.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/re.c b/re.c
index 860e1d13..7dcbe488 100644
--- a/re.c
+++ b/re.c
@@ -533,10 +533,20 @@ again:
goto done;
for (count++, sp++; *sp != '\0'; sp++) {
+ static short range_warned = FALSE;
+
if (*sp == '[')
count++;
else if (*sp == ']')
count--;
+ if (*sp == '-' && ! range_warned && count == 1
+ && sp[-1] != '[' && sp[1] != ']'
+ && ! isdigit(sp[-1]) && ! isdigit(sp[1])) {
+ /* found a range, we think */
+ range_warned = TRUE;
+ warning(_("range of the form `[%c-%c]' is locale dependant"),
+ sp[-1], sp[1]);
+ }
if (count == 0)
break;
}