* src/fileio.c (Finsert_file_contents): Don't assume beg_offset is 0.
authorStefan Monnier <monnier@iro.umontreal.ca>
Mon, 12 Sep 2011 02:22:22 +0000 (22:22 -0400)
committerStefan Monnier <monnier@iro.umontreal.ca>
Mon, 12 Sep 2011 02:22:22 +0000 (22:22 -0400)
src/ChangeLog
src/fileio.c

index 456c6aa..191462c 100644 (file)
@@ -1,3 +1,7 @@
+2011-09-12  Stefan Monnier  <monnier@iro.umontreal.ca>
+
+       * fileio.c (Finsert_file_contents): Don't assume beg_offset is 0.
+
 2011-09-11  Chong Yidong  <cyd@stupidchicken.com>
 
        * minibuf.c (Fread_from_minibuffer): Doc fix.
index e48fd89..08be41f 100644 (file)
@@ -3546,7 +3546,7 @@ variable `last-coding-system-used' to the coding system actually used.  */)
       immediate_quit = 0;
       /* If the file matches the buffer completely,
         there's no need to replace anything.  */
-      if (same_at_start - BEGV_BYTE == end_offset)
+      if (same_at_start - BEGV_BYTE == end_offset - beg_offset)
        {
          emacs_close (fd);
          specpdl_ptr--;