summaryrefslogtreecommitdiffstats
path: root/lib.c
diff options
context:
space:
mode:
Diffstat (limited to 'lib.c')
-rw-r--r--lib.c11
1 files changed, 5 insertions, 6 deletions
diff --git a/lib.c b/lib.c
index 92d218a6..cfa2d2bb 100644
--- a/lib.c
+++ b/lib.c
@@ -1298,17 +1298,16 @@ val ldiff(val list1, val list2)
list2 = nullify(list2);
switch (type(list2)) {
- case STR:
- case LIT:
- case LSTR:
- case VEC:
- while (list1 && !equal(list1, list2)) {
+ case NIL:
+ case CONS:
+ case LCONS:
+ while (list1 && list1 != list2) {
ptail = list_collect(ptail, car(list1));
list1 = cdr(list1);
}
break;
default:
- while (list1 && list1 != list2) {
+ while (list1 && !equal(list1, list2)) {
ptail = list_collect(ptail, car(list1));
list1 = cdr(list1);
}