summaryrefslogtreecommitdiffstats
path: root/lib.c
diff options
context:
space:
mode:
authorKaz Kylheku <kaz@kylheku.com>2012-03-24 00:20:46 -0700
committerKaz Kylheku <kaz@kylheku.com>2012-03-24 00:20:46 -0700
commit7ea334385cb123772e86341148b32ac0a1783741 (patch)
treecafca51b48f41ff9d6df3602e592e24caac0a186 /lib.c
parentb8e732a4094e285d6d178db79ced226816a4f3f1 (diff)
downloadtxr-7ea334385cb123772e86341148b32ac0a1783741.tar.gz
txr-7ea334385cb123772e86341148b32ac0a1783741.tar.bz2
txr-7ea334385cb123772e86341148b32ac0a1783741.zip
* lib.c (search_str): If start_num is nil, default it to zero.
This is needed for this to work right as an optional argument.
Diffstat (limited to 'lib.c')
-rw-r--r--lib.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/lib.c b/lib.c
index 21b87fed..6cbff8ba 100644
--- a/lib.c
+++ b/lib.c
@@ -1490,6 +1490,10 @@ const wchar_t *c_str(val obj)
val search_str(val haystack, val needle, val start_num, val from_end)
{
+ uses_or2;
+
+ start_num = or2(start_num, zero);
+
if (length_str_lt(haystack, start_num)) {
return nil;
} else {