summaryrefslogtreecommitdiffstats
path: root/lib.c
diff options
context:
space:
mode:
authorKaz Kylheku <kaz@kylheku.com>2014-06-30 06:30:30 -0700
committerKaz Kylheku <kaz@kylheku.com>2014-06-30 13:30:45 -0700
commit4aac1a2a6144d04a047966e295727258bd09a734 (patch)
tree715b3e220b5e1501979fd71a94f8767cfaa5a2f6 /lib.c
parentf69bc0426a3f94318ef89dba18cdad3cbed180e7 (diff)
downloadtxr-4aac1a2a6144d04a047966e295727258bd09a734.tar.gz
txr-4aac1a2a6144d04a047966e295727258bd09a734.tar.bz2
txr-4aac1a2a6144d04a047966e295727258bd09a734.zip
* lib.c (sel): Bugfix: not implemented correctly for sequences
which are lists.
Diffstat (limited to 'lib.c')
-rw-r--r--lib.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/lib.c b/lib.c
index 8a6f9ed2..e45902c1 100644
--- a/lib.c
+++ b/lib.c
@@ -5576,10 +5576,8 @@ val sel(val seq_in, val where_in)
for (; seq && where; seq = cdr(seq), idx = plus(idx, one)) {
val wh;
- do {
- wh = car(where);
- where = cdr(where);
- } while (lt(wh, idx));
+ for (; where && lt(wh = car(where), idx); where = cdr(where))
+ ; /* empty */
if (eql(wh, idx))
ptail = list_collect (ptail, car(seq));