From e6490bd2d550a82297485b31799ede2538876a57 Mon Sep 17 00:00:00 2001 From: Daniel Cerqueira Date: Sun, 16 Aug 2026 15:23:37 +0100 Subject: fix bug in primitiveDiff() --- liblali.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/liblali.c b/liblali.c index cfd4d76..831cc66 100644 --- a/liblali.c +++ b/liblali.c @@ -855,13 +855,13 @@ Object *primitiveDiff(Object **args, GC_PARAM) { (first->type == TYPE_SYMBOL && second->type == TYPE_SYMBOL)) return strcmp(first->string, second->string) ? t : f; else if (first->type == TYPE_CONS && second->type == TYPE_CONS) { - for (; (first->cdr != nil || second->cdr != nil); + for (; (first->cdr->type == TYPE_CONS && second->cdr->type == TYPE_CONS); first = first->cdr, second = second->cdr) { if (strcmp(first->string, second->string)) return t; } return (strcmp(first->car->string, second->car->string) || - (first->cdr != nil && second->cdr != nil)) ? t : f; + strcmp(first->cdr->string, second->cdr->string)) ? t : f; } else return t; -- cgit