diff options
| author | Richard M. Stallman | 2004-12-02 23:37:13 +0000 |
|---|---|---|
| committer | Richard M. Stallman | 2004-12-02 23:37:13 +0000 |
| commit | d8bf42567e956447313be88c742e7330e12192f0 (patch) | |
| tree | 55a0d9cb192e41aae5aada0b898b7e0d21b34318 /src | |
| parent | 0b31741cdc1014fedcdca9aaed39d0173f847308 (diff) | |
| download | emacs-d8bf42567e956447313be88c742e7330e12192f0.tar.gz emacs-d8bf42567e956447313be88c742e7330e12192f0.zip | |
(insert_from_string_before_markers)
(insert_from_string): Don't modify buffer on empty insertion.
Diffstat (limited to 'src')
| -rw-r--r-- | src/insdel.c | 8 |
1 files changed, 8 insertions, 0 deletions
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) | |||
| 1057 | int inherit; | 1057 | int inherit; |
| 1058 | { | 1058 | { |
| 1059 | int opoint = PT; | 1059 | int opoint = PT; |
| 1060 | |||
| 1061 | if (SCHARS (string) == 0) | ||
| 1062 | return; | ||
| 1063 | |||
| 1060 | insert_from_string_1 (string, pos, pos_byte, length, length_byte, | 1064 | insert_from_string_1 (string, pos, pos_byte, length, length_byte, |
| 1061 | inherit, 0); | 1065 | inherit, 0); |
| 1062 | signal_after_change (opoint, 0, PT - opoint); | 1066 | signal_after_change (opoint, 0, PT - opoint); |
| @@ -1074,6 +1078,10 @@ insert_from_string_before_markers (string, pos, pos_byte, | |||
| 1074 | int inherit; | 1078 | int inherit; |
| 1075 | { | 1079 | { |
| 1076 | int opoint = PT; | 1080 | int opoint = PT; |
| 1081 | |||
| 1082 | if (SCHARS (string) == 0) | ||
| 1083 | return; | ||
| 1084 | |||
| 1077 | insert_from_string_1 (string, pos, pos_byte, length, length_byte, | 1085 | insert_from_string_1 (string, pos, pos_byte, length, length_byte, |
| 1078 | inherit, 1); | 1086 | inherit, 1); |
| 1079 | signal_after_change (opoint, 0, PT - opoint); | 1087 | signal_after_change (opoint, 0, PT - opoint); |