# HG changeset patch # User Ken Raeburn # Date 1248168390 0 # Node ID b426d08d0ba3bdffbb85806da2f564c9b37a9bc9 # Parent 76ec8228b5d8feb1f2151f5aa9a6d9612c304335 (load_depth): New variable. (Fload, load_unwind, init_lread): Set it to the load recursion depth; set load_in_progress as a simple boolean based on the current load_depth. (Bug#3892) diff -r 76ec8228b5d8 -r b426d08d0ba3 src/lread.c --- a/src/lread.c Tue Jul 21 06:46:33 2009 +0000 +++ b/src/lread.c Tue Jul 21 09:26:30 2009 +0000 @@ -100,6 +100,9 @@ /* non-zero if inside `load' */ int load_in_progress; +/* Depth of nested `load' invocations. */ +int load_depth; + /* Directory in which the sources were found. */ Lisp_Object Vsource_directory; @@ -1250,7 +1253,8 @@ specbind (Qinhibit_file_name_operation, Qnil); load_descriptor_list = Fcons (make_number (fileno (stream)), load_descriptor_list); - load_in_progress++; + load_depth++; + load_in_progress = 1; if (! version || version >= 22) readevalloop (Qget_file_char, stream, hist_file_name, Feval, 0, Qnil, Qnil, Qnil, Qnil); @@ -1312,7 +1316,8 @@ fclose (stream); UNBLOCK_INPUT; } - if (--load_in_progress < 0) load_in_progress = 0; + if (--load_depth < 0) load_depth = 0; + load_in_progress = load_depth > 0; return Qnil; } @@ -4129,6 +4134,7 @@ Vvalues = Qnil; load_in_progress = 0; + load_depth = 0; Vload_file_name = Qnil; load_descriptor_list = Qnil;