(do_autoload): Fixed the bug in the autoload-saving code.
authorEric S. Raymond <esr@snark.thyrsus.com>
Wed, 28 Apr 1993 17:08:18 +0000 (17:08 +0000)
committerEric S. Raymond <esr@snark.thyrsus.com>
Wed, 28 Apr 1993 17:08:18 +0000 (17:08 +0000)
src/eval.c

index 445ff08..8cd05ca 100644 (file)
@@ -1391,7 +1391,6 @@ do_autoload (fundef, funname)
   Vautoload_queue = Qt;
   Fload (Fcar (Fcdr (fundef)), Qnil, noninteractive ? Qt : Qnil, Qnil);
 
-#ifdef UNLOAD
   /* Save the old autoloads, in case we ever do an unload. */
   queue = Vautoload_queue;
   while (CONSP (queue))
@@ -1399,11 +1398,15 @@ do_autoload (fundef, funname)
       first = Fcar (queue);
       second = Fcdr (first);
       first = Fcar (first);
-      if (!EQ (second, Qnil))
+
+      /* Note: This test is subtle.  The cdr of an autoload-queue entry
+        may be an atom if the autoload entry was generated by a defalias
+        or fset. */
+      if (CONSP (second))
          Fput(first, Qautoload, (Fcdr (second)));
+
       queue = Fcdr (queue);
     }
-#endif /* UNLOAD */
 
   /* Once loading finishes, don't undo it.  */
   Vautoload_queue = Qt;