From 8fc457448c63cca8e21a85c42907b2d079ff1442 Mon Sep 17 00:00:00 2001 From: Juanma Barranquero Date: Wed, 25 Feb 2009 12:47:23 +0000 Subject: * lread.c (Fload): Stop checking Vloads_in_progress and signal error as soon as a recursive load is detected. --- src/ChangeLog | 5 +++++ src/lread.c | 14 ++++++-------- 2 files changed, 11 insertions(+), 8 deletions(-) diff --git a/src/ChangeLog b/src/ChangeLog index 60dc389335b..120c0929684 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,8 @@ +2009-02-25 Juanma Barranquero + + * lread.c (Fload): Stop checking Vloads_in_progress as soon as + a recursive load is detected. + 2009-02-24 Adrian Robert * nsterm.m (ns_ring_bell): Convert rect to window coordinates diff --git a/src/lread.c b/src/lread.c index e5894d6d3e9..063adba1d9a 100644 --- a/src/lread.c +++ b/src/lread.c @@ -1113,14 +1113,12 @@ Return t if the file exists and loads successfully. */) int count = 0; Lisp_Object tem; for (tem = Vloads_in_progress; CONSP (tem); tem = XCDR (tem)) - if (!NILP (Fequal (found, XCAR (tem)))) - count++; - if (count > 3) - { - if (fd >= 0) - emacs_close (fd); - signal_error ("Recursive load", Fcons (found, Vloads_in_progress)); - } + if (!NILP (Fequal (found, XCAR (tem))) && (++count > 3)) + { + if (fd >= 0) + emacs_close (fd); + signal_error ("Recursive load", Fcons (found, Vloads_in_progress)); + } record_unwind_protect (record_load_unwind, Vloads_in_progress); Vloads_in_progress = Fcons (found, Vloads_in_progress); } -- cgit v1.2.1