From 0642a9d229fd3e478c2aa0decea91b3a9bef2024 Mon Sep 17 00:00:00 2001 From: Kaz Kylheku Date: Wed, 23 Sep 2015 05:57:46 -0700 Subject: 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. --- lib.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib.c b/lib.c index 671e13ac..42f6cb04 100644 --- a/lib.c +++ b/lib.c @@ -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)) { -- cgit v1.2.3