aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorStefan Monnier2004-09-15 00:28:04 +0000
committerStefan Monnier2004-09-15 00:28:04 +0000
commit4b70e2c95f4f6b383905f06d86f2d19faf4d774c (patch)
tree7fa12b124b59a249208a5895bd79e775567702cb /src
parent1b0338f79465c40fb01621a8b83167d6c8de32f0 (diff)
downloademacs-4b70e2c95f4f6b383905f06d86f2d19faf4d774c.tar.gz
emacs-4b70e2c95f4f6b383905f06d86f2d19faf4d774c.zip
(Finsert_file_contents): Fix case of replacement in a narrowed buffer.
Diffstat (limited to 'src')
-rw-r--r--src/ChangeLog5
-rw-r--r--src/fileio.c8
2 files changed, 9 insertions, 4 deletions
diff --git a/src/ChangeLog b/src/ChangeLog
index df66164f8cd..955c8929f92 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,3 +1,8 @@
12004-09-14 Stefan <monnier@iro.umontreal.ca>
2
3 * fileio.c (Finsert_file_contents): Fix case of replacement in a
4 narrowed buffer.
5
12004-09-14 Kim F. Storm <storm@cua.dk> 62004-09-14 Kim F. Storm <storm@cua.dk>
2 7
3 * puresize.h (PURESIZE_RATIO): Define based on BITS_PER_EMACS_INT. 8 * puresize.h (PURESIZE_RATIO): Define based on BITS_PER_EMACS_INT.
diff --git a/src/fileio.c b/src/fileio.c
index e9a6c558e33..56dbae6f877 100644
--- a/src/fileio.c
+++ b/src/fileio.c
@@ -1,6 +1,6 @@
1/* File IO for GNU Emacs. 1/* File IO for GNU Emacs.
2 Copyright (C) 1985,86,87,88,93,94,95,96,97,98,99,2000,01,03,2004 2 Copyright (C) 1985, 1986, 1987, 1988, 1993, 1994, 1995, 1996, 1997, 1998,
3 Free Software Foundation, Inc. 3 1999, 2000, 2001, 2003, 2004 Free Software Foundation, Inc.
4 4
5This file is part of GNU Emacs. 5This file is part of GNU Emacs.
6 6
@@ -4327,7 +4327,7 @@ actually used. */)
4327 /* Replace the chars that we need to replace, 4327 /* Replace the chars that we need to replace,
4328 and update INSERTED to equal the number of bytes 4328 and update INSERTED to equal the number of bytes
4329 we are taking from the file. */ 4329 we are taking from the file. */
4330 inserted -= (Z_BYTE - same_at_end) + (same_at_start - BEG_BYTE); 4330 inserted -= (ZV_BYTE - same_at_end) + (same_at_start - BEGV_BYTE);
4331 4331
4332 if (same_at_end != same_at_start) 4332 if (same_at_end != same_at_start)
4333 { 4333 {
@@ -4341,7 +4341,7 @@ actually used. */)
4341 } 4341 }
4342 /* Insert from the file at the proper position. */ 4342 /* Insert from the file at the proper position. */
4343 SET_PT_BOTH (temp, same_at_start); 4343 SET_PT_BOTH (temp, same_at_start);
4344 insert_1 (conversion_buffer + same_at_start - BEG_BYTE, inserted, 4344 insert_1 (conversion_buffer + same_at_start - BEGV_BYTE, inserted,
4345 0, 0, 0); 4345 0, 0, 0);
4346 if (coding.cmp_data && coding.cmp_data->used) 4346 if (coding.cmp_data && coding.cmp_data->used)
4347 coding_restore_composition (&coding, Fcurrent_buffer ()); 4347 coding_restore_composition (&coding, Fcurrent_buffer ());