emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] Changes to emacs/src/fileio.c,v


From: Chong Yidong
Subject: [Emacs-diffs] Changes to emacs/src/fileio.c,v
Date: Fri, 14 Nov 2008 21:11:16 +0000

CVSROOT:        /sources/emacs
Module name:    emacs
Changes by:     Chong Yidong <cyd>      08/11/14 21:11:15

Index: fileio.c
===================================================================
RCS file: /sources/emacs/emacs/src/fileio.c,v
retrieving revision 1.641
retrieving revision 1.642
diff -u -b -r1.641 -r1.642
--- fileio.c    20 Oct 2008 10:10:12 -0000      1.641
+++ fileio.c    14 Nov 2008 21:11:15 -0000      1.642
@@ -3144,6 +3144,7 @@
   int read_quit = 0;
   Lisp_Object old_Vdeactivate_mark = Vdeactivate_mark;
   int we_locked_file = 0;
+  int deferred_remove_unwind_protect = 0;
 
   if (current_buffer->base_buffer && ! NILP (visit))
     error ("Cannot do file visiting in an indirect buffer");
@@ -3656,6 +3657,11 @@
       UNGCPRO;
       emacs_close (fd);
 
+      /* We should remove the unwind_protect calling
+        close_file_unwind, but other stuff has been added the stack,
+        so defer the removal till we reach the `handled' label.  */
+      deferred_remove_unwind_protect = 1;
+
       /* At this point, HOW_MUCH should equal TOTAL, or should be <= 0
         if we couldn't read the file.  */
 
@@ -4037,6 +4043,11 @@
 
  handled:
 
+  if (deferred_remove_unwind_protect)
+    /* If requested above, discard the unwind protect for closing the
+       file.  */
+    specpdl_ptr--;
+
   if (!NILP (visit))
     {
       if (!EQ (current_buffer->undo_list, Qt) && !nochange)




reply via email to

[Prev in Thread] Current Thread [Next in Thread]