diff options
author | Kaz Kylheku <kaz@kylheku.com> | 2012-03-24 00:20:46 -0700 |
---|---|---|
committer | Kaz Kylheku <kaz@kylheku.com> | 2012-03-24 00:20:46 -0700 |
commit | 7ea334385cb123772e86341148b32ac0a1783741 (patch) | |
tree | cafca51b48f41ff9d6df3602e592e24caac0a186 /lib.c | |
parent | b8e732a4094e285d6d178db79ced226816a4f3f1 (diff) | |
download | txr-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.c | 4 |
1 files changed, 4 insertions, 0 deletions
@@ -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 { |