diff options
author | Kaz Kylheku <kaz@kylheku.com> | 2014-03-09 20:15:52 -0700 |
---|---|---|
committer | Kaz Kylheku <kaz@kylheku.com> | 2014-03-09 20:15:52 -0700 |
commit | 6d962407c0ea219214c752a7a63fac83adab0301 (patch) | |
tree | d0167abb0f827cc67ae3002f3c0d6f648e71d7d2 | |
parent | 0c514dc343033eafde26679f858796549a96cc8d (diff) | |
download | txr-6d962407c0ea219214c752a7a63fac83adab0301.tar.gz txr-6d962407c0ea219214c752a7a63fac83adab0301.tar.bz2 txr-6d962407c0ea219214c752a7a63fac83adab0301.zip |
* 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.
-rw-r--r-- | ChangeLog | 8 | ||||
-rw-r--r-- | lib.c | 2 | ||||
-rw-r--r-- | match.c | 2 |
3 files changed, 10 insertions, 2 deletions
@@ -1,5 +1,13 @@ 2014-03-09 Kaz Kylheku <kaz@kylheku.com> + * 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 <kaz@kylheku.com> + Fixing broken processing of horizontal matching across long lines produced by @(freeform). Once the matching passes about 4000 characters, the "consume_prefix" @@ -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); } @@ -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); |