aboutsummaryrefslogtreecommitdiffstats
path: root/re.c
diff options
context:
space:
mode:
authorArnold D. Robbins <arnold@skeeve.com>2011-02-07 22:36:38 +0200
committerArnold D. Robbins <arnold@skeeve.com>2011-02-07 22:36:38 +0200
commit00d797090ffd9dcc7b1a8fa729c542846ab0242b (patch)
tree2960fd09ce1460da938737de06e83289b5e47a15 /re.c
parentd26dc534cf748c810d19b9daf4185b8dfaff1a9c (diff)
downloadegawk-00d797090ffd9dcc7b1a8fa729c542846ab0242b.tar.gz
egawk-00d797090ffd9dcc7b1a8fa729c542846ab0242b.tar.bz2
egawk-00d797090ffd9dcc7b1a8fa729c542846ab0242b.zip
Regex bug fix and token bug fix. See ChangeLog.
Diffstat (limited to 're.c')
-rw-r--r--re.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/re.c b/re.c
index 091a7774..b386aa68 100644
--- a/re.c
+++ b/re.c
@@ -525,7 +525,7 @@ void
dfawarn(const char *dfa_warning)
{
/*
- * This routine does nothing, since gawk does it's own
+ * This routine does nothing, since gawk does its own
* (better) check for bad [[:foo:]] syntax.
*/
}
@@ -680,7 +680,14 @@ again:
goto done;
copy(); /* copy in the [ */
- if (*sp == '-') /* it's literal, just copy it and skip over */
+ if (*sp == '^') /* allow for negation of range */
+ copy();
+
+ /*
+ * Minus as first character after [ or ^ is literal,
+ * just copy it and skip over.
+ */
+ if (*sp == '-')
copy();
while (count > 0 && len > 0) {