diff options
author | Kaz Kylheku <kaz@kylheku.com> | 2012-02-28 14:12:05 -0800 |
---|---|---|
committer | Kaz Kylheku <kaz@kylheku.com> | 2012-02-28 14:12:05 -0800 |
commit | 7ff528543a67f6d6949924344a50c8503ec5396e (patch) | |
tree | 3e23498e69dc8fff25339437693ac3de7c46969d /lib.c | |
parent | 1b359783aabdd40a9c3f96c5514843de21a2319f (diff) | |
download | txr-7ff528543a67f6d6949924344a50c8503ec5396e.tar.gz txr-7ff528543a67f6d6949924344a50c8503ec5396e.tar.bz2 txr-7ff528543a67f6d6949924344a50c8503ec5396e.zip |
* lib.c (sub_list, replace_list, lazy_sub_str, sub_str, replace_str,
sub_vec, replace_vec): Regression: replace incorrect zerop(to)
test with to == zero, because to is not necessarily a number.
Diffstat (limited to 'lib.c')
-rw-r--r-- | lib.c | 14 |
1 files changed, 7 insertions, 7 deletions
@@ -445,7 +445,7 @@ val sub_list(val list, val from, val to) from = nil; else if (lt(from, zero)) { from = plus(from, len = length(list)); - if (zerop(to)) + if (to == zero) to = nil; } @@ -499,7 +499,7 @@ val replace_list(val list, val items, val from, val to) from = nil; else if (lt(from, zero)) { from = plus(from, len ? len : (len = length(list))); - if (zerop(to)) + if (to == zero) to = len; } @@ -1490,7 +1490,7 @@ static val lazy_sub_str(val lstr, val from, val to) from = plus(from, len = length_str(lstr)); from = max2(zero, from); - if (zerop(to)) + if (to == zero) to = t; } @@ -1545,7 +1545,7 @@ val sub_str(val str_in, val from, val to) return null_string; else if (lt(from, zero)) { from = plus(from, len); - if (zerop(to)) + if (to == zero) to = len; } @@ -1586,7 +1586,7 @@ val replace_str(val str_in, val items, val from, val to) from = len; else if (lt(from, zero)) { from = plus(from, len); - if (zerop(to)) + if (to == zero) to = len; } @@ -2956,7 +2956,7 @@ val sub_vec(val vec_in, val from, val to) from = len; else if (lt(from, zero)) { from = plus(from, len); - if (zerop(to)) + if (to == zero) to = len; } @@ -2999,7 +2999,7 @@ val replace_vec(val vec_in, val items, val from, val to) from = len; else if (lt(from, zero)) { from = plus(from, len); - if (zerop(to)) + if (to == zero) to = len; } |