From 6d962407c0ea219214c752a7a63fac83adab0301 Mon Sep 17 00:00:00 2001 From: Kaz Kylheku Date: Sun, 9 Mar 2014 20:15:52 -0700 Subject: * lib.c (lazy_sub_str): Bugfix: "from" was mistakenly used in the adjustment of the "to" value. * match.c (search_form): Use predefined constants for -1 and 1 instead of calling num. --- ChangeLog | 8 ++++++++ lib.c | 2 +- match.c | 2 +- 3 files changed, 10 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index 65dcd162..1f34a010 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +2014-03-09 Kaz Kylheku + + * lib.c (lazy_sub_str): Bugfix: "from" was mistakenly used + in the adjustment of the "to" value. + + * match.c (search_form): Use predefined constants for -1 and 1 + instead of calling num. + 2014-03-09 Kaz Kylheku Fixing broken processing of horizontal matching across diff --git a/lib.c b/lib.c index 2b5bd031..839dc116 100644 --- a/lib.c +++ b/lib.c @@ -2064,7 +2064,7 @@ static val lazy_sub_str(val lstr, val from, val to) to = t; } else { if (lt(to, zero)) { - to = plus(from, len = length_str(lstr)); + to = plus(to, len = length_str(lstr)); to = max(zero, to); } diff --git a/match.c b/match.c index 0800ebc1..a82f47da 100644 --- a/match.c +++ b/match.c @@ -457,7 +457,7 @@ static val search_form(match_line_ctx *c, val needle_form, val from_end) } else { val spec = cons(needle_form, nil); val pos = from_end ? length_str(c->dataline) : c->pos; - val step = from_end ? num(-1) : num(1); + val step = from_end ? negone : one; rlcp(spec, needle_form); -- cgit v1.2.3