summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--ChangeLog5
-rw-r--r--lib.c4
2 files changed, 9 insertions, 0 deletions
diff --git a/ChangeLog b/ChangeLog
index 3c24cd8a..3c6e0367 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2012-03-24 Kaz Kylheku <kaz@kylheku.com>
+
+ * 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.
+
2012-03-23 Kaz Kylheku <kaz@kylheku.com>
Version 62
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 {