# HG changeset patch
# User Ken Raeburn <raeburn@raeburn.org>
# Date 956774370 0
# Node ID 12d806a22931cfc7b77001f1eb8bc1c1d990b013
# Parent  48df558593f974df4a9bb045639be11c32ec8d14
(record_delete): If we hit the end of the undo list, stop picking elements
apart.

diff -r 48df558593f9 -r 12d806a22931 src/undo.c
--- a/src/undo.c	Wed Apr 26 17:46:21 2000 +0000
+++ b/src/undo.c	Wed Apr 26 18:39:30 2000 +0000
@@ -115,7 +115,10 @@
 
       while (1)
 	{
-	  elt = XCAR (tail);
+	  if (NILP (tail))
+	    elt = Qnil;
+	  else
+	    elt = XCAR (tail);
 	  if (NILP (elt) || ! (CONSP (elt) && MARKERP (XCAR (elt))))
 	    break;
 	  tail = XCDR (tail);