summaryrefslogtreecommitdiffstats
path: root/lib.c
diff options
context:
space:
mode:
authorKaz Kylheku <kaz@kylheku.com>2016-01-17 10:57:15 -0800
committerKaz Kylheku <kaz@kylheku.com>2016-01-17 10:57:15 -0800
commit1c3cecbb1a75bae5c04e5c32ba0a259b33a74c23 (patch)
treeac90603c4bc73fc30f9ec8e0bec2bc9ad12020f2 /lib.c
parentb6a5d3a37c7e38d43d30a14ab64a76596007d190 (diff)
downloadtxr-1c3cecbb1a75bae5c04e5c32ba0a259b33a74c23.tar.gz
txr-1c3cecbb1a75bae5c04e5c32ba0a259b33a74c23.tar.bz2
txr-1c3cecbb1a75bae5c04e5c32ba0a259b33a74c23.zip
partition* bugfix: incorrect behavior for 0.
lib.c (partition_star): In the special case that the indices argument is given as the integer zero, the function wrongly returned just the remaining piece of the sequence after zero, rather than a list containing this piece.
Diffstat (limited to 'lib.c')
-rw-r--r--lib.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib.c b/lib.c
index db10a056..6168bb52 100644
--- a/lib.c
+++ b/lib.c
@@ -2019,7 +2019,7 @@ val partition_star(val seq, val indices)
return cons(seq, nil);
if (indices == zero)
- return nullify(rest(seq));
+ return cons(nullify(rest(seq)), nil);
if (!seqp(indices)) {
indices = cons(indices, nil);