summaryrefslogtreecommitdiffstats
path: root/lib.c
diff options
context:
space:
mode:
authorKaz Kylheku <kaz@kylheku.com>2016-05-26 22:03:42 -0700
committerKaz Kylheku <kaz@kylheku.com>2016-05-26 22:03:42 -0700
commit3fa6e2f0428485e4be7ccaea5d57d2f0eb2bd9fe (patch)
tree29bece39ee42296ef995381d9faa2f42a79b67d4 /lib.c
parent4809602f3733c84a6b3d671992e8e24560765d53 (diff)
downloadtxr-3fa6e2f0428485e4be7ccaea5d57d2f0eb2bd9fe.tar.gz
txr-3fa6e2f0428485e4be7ccaea5d57d2f0eb2bd9fe.tar.bz2
txr-3fa6e2f0428485e4be7ccaea5d57d2f0eb2bd9fe.zip
Bugfix: argument defaulting in take-until.
* lib.c (take_until): keyfun not defaulted in list cases. Needless defaulting of key in vector/string cases, since pos function already defaults.
Diffstat (limited to 'lib.c')
-rw-r--r--lib.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib.c b/lib.c
index a0333930..04b6355d 100644
--- a/lib.c
+++ b/lib.c
@@ -7788,6 +7788,7 @@ val take_until(val pred, val seq, val keyfun)
return nil;
case CONS:
case LCONS:
+ keyfun = default_arg(keyfun, identity_f);
return make_lazy_cons(func_f1(cons(seq, cons(pred, keyfun)),
take_until_list_fun));
case LSTR:
@@ -7795,8 +7796,7 @@ val take_until(val pred, val seq, val keyfun)
case STR:
case VEC:
{
- val key = default_arg(keyfun, identity_f);
- val pos = pos_if(pred, seq, key);
+ val pos = pos_if(pred, seq, keyfun);
if (!pos)
return seq;
return sub(seq, zero, succ(pos));