From d8bf42567e956447313be88c742e7330e12192f0 Mon Sep 17 00:00:00 2001 From: "Richard M. Stallman" Date: Thu, 2 Dec 2004 23:37:13 +0000 Subject: [PATCH] (insert_from_string_before_markers) (insert_from_string): Don't modify buffer on empty insertion. --- src/insdel.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/insdel.c b/src/insdel.c index f5f56f0371f..7f10c2f523d 100644 --- a/src/insdel.c +++ b/src/insdel.c @@ -1057,6 +1057,10 @@ insert_from_string (string, pos, pos_byte, length, length_byte, inherit) int inherit; { int opoint = PT; + + if (SCHARS (string) == 0) + return; + insert_from_string_1 (string, pos, pos_byte, length, length_byte, inherit, 0); signal_after_change (opoint, 0, PT - opoint); @@ -1074,6 +1078,10 @@ insert_from_string_before_markers (string, pos, pos_byte, int inherit; { int opoint = PT; + + if (SCHARS (string) == 0) + return; + insert_from_string_1 (string, pos, pos_byte, length, length_byte, inherit, 1); signal_after_change (opoint, 0, PT - opoint); -- 2.39.5