emacs-diffs
[Top][All Lists]
Advanced

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

[Emacs-diffs] trunk r113538: * fileio.c (Finsert_file_contents): Avoid d


From: Paul Eggert
Subject: [Emacs-diffs] trunk r113538: * fileio.c (Finsert_file_contents): Avoid double-close.
Date: Thu, 25 Jul 2013 07:31:45 +0000
User-agent: Bazaar (2.6b2)

------------------------------------------------------------
revno: 113538
revision-id: address@hidden
parent: address@hidden
fixes bug: http://debbugs.gnu.org/14936
committer: Paul Eggert <address@hidden>
branch nick: trunk
timestamp: Thu 2013-07-25 08:29:36 +0100
message:
  * fileio.c (Finsert_file_contents): Avoid double-close.
modified:
  src/ChangeLog                  changelog-20091113204419-o5vbwnq5f7feedwu-1438
  src/fileio.c                   fileio.c-20091113204419-o5vbwnq5f7feedwu-210
=== modified file 'src/ChangeLog'
--- a/src/ChangeLog     2013-07-24 17:36:42 +0000
+++ b/src/ChangeLog     2013-07-25 07:29:36 +0000
@@ -1,3 +1,7 @@
+2013-07-25  Paul Eggert  <address@hidden>
+
+       * fileio.c (Finsert_file_contents): Avoid double-close (Bug#14936).
+
 2013-07-24  Eli Zaretskii  <address@hidden>
 
        * xdisp.c (redisplay_window): Instead of moving point out of

=== modified file 'src/fileio.c'
--- a/src/fileio.c      2013-07-19 01:24:35 +0000
+++ b/src/fileio.c      2013-07-25 07:29:36 +0000
@@ -3860,7 +3860,11 @@
       if (same_at_start - BEGV_BYTE == end_offset - beg_offset)
        {
          emacs_close (fd);
-         specpdl_ptr--;
+
+         /* Discard the unwind protect for closing the file, and any
+            unwind protect for restoring point.  */
+         specpdl_ptr = specpdl + fd_index;
+
          /* Truncate the buffer to the size of the file.  */
          del_range_1 (same_at_start, same_at_end, 0, 0);
          goto handled;


reply via email to

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