summaryrefslogtreecommitdiffstats
path: root/lib.c
diff options
context:
space:
mode:
authorKaz Kylheku <kaz@kylheku.com>2024-07-10 01:41:57 -0700
committerKaz Kylheku <kaz@kylheku.com>2024-07-10 01:41:57 -0700
commit2eed172a061a5df56bcc7cfda28b975165db38d3 (patch)
treeea4f652c7134d5ef746ad03ea929ba2951f967c8 /lib.c
parent42f2b87f012ca4980f326b0270b7a0c1fb34f5a0 (diff)
downloadtxr-2eed172a061a5df56bcc7cfda28b975165db38d3.tar.gz
txr-2eed172a061a5df56bcc7cfda28b975165db38d3.tar.bz2
txr-2eed172a061a5df56bcc7cfda28b975165db38d3.zip
split: fix for far negative indices.
* lib.c (split_func): In empty index case, convert sequence via sub(seq, zero, t), so that ranges are properly expanded. This was done in partition_func in the previous commit. * tests/012/seq.tl: Test cases added.
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 8b6c261f..675a5f47 100644
--- a/lib.c
+++ b/lib.c
@@ -4270,7 +4270,7 @@ static val split_func(val base, val lcons)
us_rplaca(lcons, first);
}
} else {
- us_rplaca(lcons, seq);
+ us_rplaca(lcons, sub(seq, zero, t));
us_rplacd(lcons, nil);
}
break;