]> git.eshelyaron.com Git - emacs.git/commitdiff
(Finsert_file_contents): Fix case of replacement in a narrowed buffer.
authorStefan Monnier <monnier@iro.umontreal.ca>
Wed, 15 Sep 2004 00:28:04 +0000 (00:28 +0000)
committerStefan Monnier <monnier@iro.umontreal.ca>
Wed, 15 Sep 2004 00:28:04 +0000 (00:28 +0000)
src/ChangeLog
src/fileio.c

index df66164f8cd60d4f0d7d3f6e2719ed4007cba2ac..955c8929f928003eaaf41ba0d0bf026b619c95b4 100644 (file)
@@ -1,3 +1,8 @@
+2004-09-14  Stefan  <monnier@iro.umontreal.ca>
+
+       * fileio.c (Finsert_file_contents): Fix case of replacement in a
+       narrowed buffer.
+
 2004-09-14  Kim F. Storm  <storm@cua.dk>
 
        * puresize.h (PURESIZE_RATIO): Define based on BITS_PER_EMACS_INT.
index e9a6c558e33e8bd5e656b6a651cd3adf333f0000..56dbae6f87707246c44f71cf32526d5546be296b 100644 (file)
@@ -1,6 +1,6 @@
 /* File IO for GNU Emacs.
-   Copyright (C) 1985,86,87,88,93,94,95,96,97,98,99,2000,01,03,2004
-     Free Software Foundation, Inc.
+   Copyright (C) 1985, 1986, 1987, 1988, 1993, 1994, 1995, 1996, 1997, 1998,
+     1999, 2000, 2001, 2003, 2004  Free Software Foundation, Inc.
 
 This file is part of GNU Emacs.
 
@@ -4327,7 +4327,7 @@ actually used.  */)
       /* Replace the chars that we need to replace,
         and update INSERTED to equal the number of bytes
         we are taking from the file.  */
-      inserted -= (Z_BYTE - same_at_end) + (same_at_start - BEG_BYTE);
+      inserted -= (ZV_BYTE - same_at_end) + (same_at_start - BEGV_BYTE);
 
       if (same_at_end != same_at_start)
        {
@@ -4341,7 +4341,7 @@ actually used.  */)
        }
       /* Insert from the file at the proper position.  */
       SET_PT_BOTH (temp, same_at_start);
-      insert_1 (conversion_buffer + same_at_start - BEG_BYTE, inserted,
+      insert_1 (conversion_buffer + same_at_start - BEGV_BYTE, inserted,
                0, 0, 0);
       if (coding.cmp_data && coding.cmp_data->used)
        coding_restore_composition (&coding, Fcurrent_buffer ());