From 2fab3faadbcd8ec99aa84ceecfd21568bd42e3ae Mon Sep 17 00:00:00 2001 From: Mikael Djurfeldt Date: Thu, 3 Oct 1996 11:37:38 +0000 Subject: [PATCH] * print.c (scm_iprlist): Bugfix: Added SCM_ECONSP tests in hare and tortoise scanning loop. --- libguile/print.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libguile/print.c b/libguile/print.c index 7a41bc5cf..2b79c5bb4 100644 --- a/libguile/print.c +++ b/libguile/print.c @@ -673,12 +673,12 @@ scm_iprlist (hdr, exp, tlr, port, pstate) O(depth * N) instead of O(N^2). */ hare = SCM_CDR (exp); tortoise = exp; - while (SCM_NIMP (hare)) + while (SCM_NIMP (hare) && SCM_ECONSP (hare)) { if (hare == tortoise) goto fancy_printing; hare = SCM_CDR (hare); - if (SCM_IMP (hare)) + if (SCM_IMP (hare) || SCM_NECONSP (hare)) break; hare = SCM_CDR (hare); tortoise = SCM_CDR (tortoise);