aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorPaul Eggert2013-07-25 08:29:36 +0100
committerPaul Eggert2013-07-25 08:29:36 +0100
commit9d611ffe280d0af4aa43406e5e102636606d3204 (patch)
treebb1e77433b78d5dc3ba23ac59b16f466c8a3f511 /src
parent6ccb9cab43613632ece4f62d9ee28d694bc1d666 (diff)
downloademacs-9d611ffe280d0af4aa43406e5e102636606d3204.tar.gz
emacs-9d611ffe280d0af4aa43406e5e102636606d3204.zip
* fileio.c (Finsert_file_contents): Avoid double-close.
Fixes: debbugs:14936
Diffstat (limited to 'src')
-rw-r--r--src/ChangeLog4
-rw-r--r--src/fileio.c6
2 files changed, 9 insertions, 1 deletions
diff --git a/src/ChangeLog b/src/ChangeLog
index 64b13a5ac28..56fe20fda98 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,3 +1,7 @@
12013-07-25 Paul Eggert <eggert@cs.ucla.edu>
2
3 * fileio.c (Finsert_file_contents): Avoid double-close (Bug#14936).
4
12013-07-24 Eli Zaretskii <eliz@gnu.org> 52013-07-24 Eli Zaretskii <eliz@gnu.org>
2 6
3 * xdisp.c (redisplay_window): Instead of moving point out of 7 * xdisp.c (redisplay_window): Instead of moving point out of
diff --git a/src/fileio.c b/src/fileio.c
index a19fcd9f663..1350e19ef27 100644
--- a/src/fileio.c
+++ b/src/fileio.c
@@ -3860,7 +3860,11 @@ by calling `format-decode', which see. */)
3860 if (same_at_start - BEGV_BYTE == end_offset - beg_offset) 3860 if (same_at_start - BEGV_BYTE == end_offset - beg_offset)
3861 { 3861 {
3862 emacs_close (fd); 3862 emacs_close (fd);
3863 specpdl_ptr--; 3863
3864 /* Discard the unwind protect for closing the file, and any
3865 unwind protect for restoring point. */
3866 specpdl_ptr = specpdl + fd_index;
3867
3864 /* Truncate the buffer to the size of the file. */ 3868 /* Truncate the buffer to the size of the file. */
3865 del_range_1 (same_at_start, same_at_end, 0, 0); 3869 del_range_1 (same_at_start, same_at_end, 0, 0);
3866 goto handled; 3870 goto handled;