summaryrefslogtreecommitdiffstats
path: root/lib.c
diff options
context:
space:
mode:
authorKaz Kylheku <kaz@kylheku.com>2021-06-22 07:39:30 -0700
committerKaz Kylheku <kaz@kylheku.com>2021-06-22 07:39:30 -0700
commitb9db5d41cbf4ef8fe1c07bf0f43e01e42e632702 (patch)
tree02c3dd2be0c79ca84c20a75abc12f8bcb4f220ed /lib.c
parent27ece3ffc30437f4a70228b96764e306bd5ed4f1 (diff)
downloadtxr-b9db5d41cbf4ef8fe1c07bf0f43e01e42e632702.tar.gz
txr-b9db5d41cbf4ef8fe1c07bf0f43e01e42e632702.tar.bz2
txr-b9db5d41cbf4ef8fe1c07bf0f43e01e42e632702.zip
lib: rmismatch tests and bugfix.
* lib.c (rmismatch): when left is an empty string or vector, and right is nil: we must return -1 not zero. * tests/012/seq.tl: More rmismatch tests.
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 dce7b2c3..85f3f55c 100644
--- a/lib.c
+++ b/lib.c
@@ -10996,7 +10996,7 @@ val rmismatch(val left, val right, val testfun_in, val keyfun_in)
case VEC:
switch (type(right)) {
case NIL:
- return if3(length(left) == zero, nil, zero);
+ return if3(length(left) == zero, nil, negone);
case CONS:
case LCONS:
return rmismatch(right, left, testfun, keyfun);