summaryrefslogtreecommitdiffstats
path: root/awkreg.awk
diff options
context:
space:
mode:
Diffstat (limited to 'awkreg.awk')
-rw-r--r--awkreg.awk7
1 files changed, 5 insertions, 2 deletions
diff --git a/awkreg.awk b/awkreg.awk
index 52c8353..043d44a 100644
--- a/awkreg.awk
+++ b/awkreg.awk
@@ -97,7 +97,7 @@ function eat_class(c)
function eat_bracket_exp(e,
#local
- f, o)
+ f, o, x, y)
{
o = e
e = eat_char(e)
@@ -115,6 +115,7 @@ function eat_bracket_exp(e,
continue
}
+ x = substr(e, 1, 1);
f = eat_bchar(e)
if (f == e)
@@ -123,8 +124,10 @@ function eat_bracket_exp(e,
if (matches(e, "-")) {
e = eat_char(e)
+ y = substr(e, 1, 1);
f = eat_bchar(e)
- if (f == e)
+
+ if (x > y || f == e)
return o
e = f
}