summaryrefslogtreecommitdiff
path: root/re.c
diff options
context:
space:
mode:
authorArnold D. Robbins <arnold@skeeve.com>2010-11-29 22:03:40 +0200
committerArnold D. Robbins <arnold@skeeve.com>2010-11-29 22:03:40 +0200
commitda212ddb7ed3f4578f1c83d9e0e472245efbea1e (patch)
tree325d01bb8203e5ea4bd70ff06faffbf21cb93beb /re.c
parent28436897d3289b4fe1b7e84e63c9cffecfcb17f6 (diff)
downloadgawk-da212ddb7ed3f4578f1c83d9e0e472245efbea1e.tar.gz
Doc updates. Strftime fix for PC. Check ranges in REs.
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;
}