summaryrefslogtreecommitdiffstats
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
commit9e441dc12313b4ce17e6203d3719f7116a32169c (patch)
tree29bece39ee42296ef995381d9faa2f42a79b67d4
parent1b69a09bcd3dadd2247bf00cf0765aa560237702 (diff)
downloadtxr-9e441dc12313b4ce17e6203d3719f7116a32169c.tar.gz
txr-9e441dc12313b4ce17e6203d3719f7116a32169c.tar.bz2
txr-9e441dc12313b4ce17e6203d3719f7116a32169c.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.
-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));