From 0705320f5323375ac338907c5b5a547d99aed501 Mon Sep 17 00:00:00 2001 From: Jan Nieuwenhuizen Date: Thu, 24 Oct 2019 11:29:08 +0200 Subject: [PATCH] core: assoc_string: Prepare for M2-Planet. src/mes.c (assoc_string): Prepare for M2-Planet. --- src/mes.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/src/mes.c b/src/mes.c index 9371babb..cf1a2cb1 100644 --- a/src/mes.c +++ b/src/mes.c @@ -32,8 +32,15 @@ SCM assoc_string (SCM x, SCM a) /*:((internal)) */ { - while (a != cell_nil && (TYPE (CAAR (a)) != TSTRING || string_equal_p (x, CAAR (a)) == cell_f)) - a = CDR (a); + SCM b; + while (a != cell_nil) + { + b = CAR (a); + if (TYPE (CAR (b)) == TSTRING) + if (string_equal_p (x, CAR (b)) == cell_t) + return b; + a = CDR (a); + } if (a != cell_nil) return CAR (a); return cell_f;