From f1a6b2163ced8440664a1e0045f7124298386d01 Mon Sep 17 00:00:00 2001 From: Stefan Monnier Date: Thu, 3 Apr 2008 20:01:31 +0000 Subject: [PATCH] (insert_from_buffer_1): Don't compare bytes in destination buffer with byte-size of source buffer. --- src/ChangeLog | 5 +++++ src/insdel.c | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/src/ChangeLog b/src/ChangeLog index 2093bb61752..5ae4fc6beb8 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,8 @@ +2008-04-03 Stefan Monnier + + * insdel.c (insert_from_buffer_1): Don't compare bytes in destination + buffer with byte-size of source buffer. + 2008-04-03 Chong Yidong * callint.c (Fcall_interactively): Handle temporary region even diff --git a/src/insdel.c b/src/insdel.c index 2919c183ab7..884620d3899 100644 --- a/src/insdel.c +++ b/src/insdel.c @@ -1352,7 +1352,7 @@ insert_from_buffer_1 (buf, from, nchars, inherit) /* Get the intervals for the part of the string we are inserting. */ intervals = BUF_INTERVALS (buf); - if (outgoing_nbytes < BUF_Z_BYTE (buf) - BUF_BEG_BYTE (buf)) + if (nchars < BUF_Z (buf) - BUF_BEG (buf)) { if (buf == current_buffer && PT <= from) from += nchars; -- 2.11.4.GIT