diff options
author | Kaz Kylheku <kaz@kylheku.com> | 2015-09-23 05:57:46 -0700 |
---|---|---|
committer | Kaz Kylheku <kaz@kylheku.com> | 2015-09-23 05:57:46 -0700 |
commit | 0642a9d229fd3e478c2aa0decea91b3a9bef2024 (patch) | |
tree | e255b0489f482564b9500790a4126eeff3020bd8 /lib.c | |
parent | 312ce645143aa6ba2890b57830523fea98a373e4 (diff) | |
download | txr-0642a9d229fd3e478c2aa0decea91b3a9bef2024.tar.gz txr-0642a9d229fd3e478c2aa0decea91b3a9bef2024.tar.bz2 txr-0642a9d229fd3e478c2aa0decea91b3a9bef2024.zip |
lack of optional arg defaulting in lazy_sub_str.
* lib.c (lazy_sub_str): Check from and to args
correctly using null_or_missing_p instead of
comparing to nil.
Diffstat (limited to 'lib.c')
-rw-r--r-- | lib.c | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -2819,7 +2819,7 @@ static val lazy_sub_str(val lstr, val from, val to) val len = nil; val len_pfx = length_str(lstr->ls.prefix); - if (from == nil) { + if (null_or_missing_p(from)) { from = zero; } else if (from == t) { return null_string; @@ -2838,7 +2838,7 @@ static val lazy_sub_str(val lstr, val from, val to) } } - if (to == nil || to == t) { + if (null_or_missing_p(to) || to == t) { to = t; } else { if (lt(to, zero)) { |