aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorGerd Moellmann2000-03-27 15:48:36 +0000
committerGerd Moellmann2000-03-27 15:48:36 +0000
commit7439e5b9ca61c98078e7dd51c8a4769fcf20377f (patch)
tree67f9766b2a642dd7170ce9ef4ffacd65589e0d47 /src
parentd9c545daed804dea4c79782e5249ef79269f4517 (diff)
downloademacs-7439e5b9ca61c98078e7dd51c8a4769fcf20377f.tar.gz
emacs-7439e5b9ca61c98078e7dd51c8a4769fcf20377f.zip
(Fsubst_char_in_region): Don't use INC_POS in unibyte
buffers because it looks for multibyte character sequences which don't exist in unibyte text.
Diffstat (limited to 'src')
-rw-r--r--src/ChangeLog4
-rw-r--r--src/editfns.c8
2 files changed, 10 insertions, 2 deletions
diff --git a/src/ChangeLog b/src/ChangeLog
index 285bbf211a0..0c4bf7ea82e 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,5 +1,9 @@
12000-03-27 Gerd Moellmann <gerd@gnu.org> 12000-03-27 Gerd Moellmann <gerd@gnu.org>
2 2
3 * editfns.c (Fsubst_char_in_region): Don't use INC_POS in unibyte
4 buffers because it looks for multibyte character sequences which
5 don't exist in unibyte text.
6
3 * xterm.h (x_specified_cursor_type, x_copy_color): Add prototypes. 7 * xterm.h (x_specified_cursor_type, x_copy_color): Add prototypes.
4 8
5 * xfaces.c (register_color, unregister_colors, unregister_colors) 9 * xfaces.c (register_color, unregister_colors, unregister_colors)
diff --git a/src/editfns.c b/src/editfns.c
index 4e25655f492..12db1a310dd 100644
--- a/src/editfns.c
+++ b/src/editfns.c
@@ -2280,12 +2280,13 @@ Both characters must have the same length of multi-byte form.")
2280#define COMBINING_BOTH (COMBINING_BEFORE | COMBINING_AFTER) 2280#define COMBINING_BOTH (COMBINING_BEFORE | COMBINING_AFTER)
2281 int maybe_byte_combining = COMBINING_NO; 2281 int maybe_byte_combining = COMBINING_NO;
2282 int last_changed; 2282 int last_changed;
2283 int multibyte_p = !NILP (current_buffer->enable_multibyte_characters);
2283 2284
2284 validate_region (&start, &end); 2285 validate_region (&start, &end);
2285 CHECK_NUMBER (fromchar, 2); 2286 CHECK_NUMBER (fromchar, 2);
2286 CHECK_NUMBER (tochar, 3); 2287 CHECK_NUMBER (tochar, 3);
2287 2288
2288 if (! NILP (current_buffer->enable_multibyte_characters)) 2289 if (multibyte_p)
2289 { 2290 {
2290 len = CHAR_STRING (XFASTINT (fromchar), fromstr); 2291 len = CHAR_STRING (XFASTINT (fromchar), fromstr);
2291 if (CHAR_STRING (XFASTINT (tochar), tostr) != len) 2292 if (CHAR_STRING (XFASTINT (tochar), tostr) != len)
@@ -2341,7 +2342,10 @@ Both characters must have the same length of multi-byte form.")
2341 stop = end_byte; 2342 stop = end_byte;
2342 } 2343 }
2343 p = BYTE_POS_ADDR (pos_byte); 2344 p = BYTE_POS_ADDR (pos_byte);
2344 INC_POS (pos_byte_next); 2345 if (multibyte_p)
2346 INC_POS (pos_byte_next);
2347 else
2348 ++pos_byte_next;
2345 if (pos_byte_next - pos_byte == len 2349 if (pos_byte_next - pos_byte == len
2346 && p[0] == fromstr[0] 2350 && p[0] == fromstr[0]
2347 && (len == 1 2351 && (len == 1