summaryrefslogtreecommitdiffstats
path: root/match.c
diff options
context:
space:
mode:
authorKaz Kylheku <kaz@kylheku.com>2011-11-22 16:51:26 -0800
committerKaz Kylheku <kaz@kylheku.com>2011-11-22 16:51:26 -0800
commitd9f00cc8a2cb018377e7cd7ea44d35f7ce710f07 (patch)
treeb0f5539e84d5a5e5a307b32068340bba08386059 /match.c
parentfcd519070bd9ea1249fe430a172e10e57dda8574 (diff)
downloadtxr-d9f00cc8a2cb018377e7cd7ea44d35f7ce710f07.tar.gz
txr-d9f00cc8a2cb018377e7cd7ea44d35f7ce710f07.tar.bz2
txr-d9f00cc8a2cb018377e7cd7ea44d35f7ce710f07.zip
* match.c (search_form): Bugfix: we must search to one character
position after the end of the line, otherwise we can never match @(eol). (h_eol): Bugfix: do not return t, but the line length. * txr.1: Warn users about @var@(bind ...) pitfall. * RELNOTES: Updated.
Diffstat (limited to 'match.c')
-rw-r--r--match.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/match.c b/match.c
index 05b542bd..52f79624 100644
--- a/match.c
+++ b/match.c
@@ -411,7 +411,7 @@ static val search_form(match_line_ctx *c, val needle_form, val from_end)
rlcp(spec, needle_form);
- for (; (from_end && ge(pos, c->pos)) || length_str_gt(c->dataline, pos);
+ for (; (from_end && ge(pos, c->pos)) || length_str_ge(c->dataline, pos);
pos = plus(pos, step))
{
cons_bind (new_bindings, new_pos,
@@ -1062,7 +1062,7 @@ static val h_eol(match_line_ctx c, match_line_ctx *cout)
if (length_str_le(c.dataline, c.pos)) {
LOG_MATCH("eol", c.pos);
- return cons(c.bindings, t);
+ return cons(c.bindings, c.pos);
}
LOG_MISMATCH("eol");
return nil;