mirror of
git://git.sv.gnu.org/emacs.git
synced 2026-04-27 08:43:40 -07:00
(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.
This commit is contained in:
parent
d9c545daed
commit
7439e5b9ca
2 changed files with 10 additions and 2 deletions
|
|
@ -1,5 +1,9 @@
|
|||
2000-03-27 Gerd Moellmann <gerd@gnu.org>
|
||||
|
||||
* editfns.c (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.
|
||||
|
||||
* xterm.h (x_specified_cursor_type, x_copy_color): Add prototypes.
|
||||
|
||||
* xfaces.c (register_color, unregister_colors, unregister_colors)
|
||||
|
|
|
|||
|
|
@ -2280,12 +2280,13 @@ Both characters must have the same length of multi-byte form.")
|
|||
#define COMBINING_BOTH (COMBINING_BEFORE | COMBINING_AFTER)
|
||||
int maybe_byte_combining = COMBINING_NO;
|
||||
int last_changed;
|
||||
int multibyte_p = !NILP (current_buffer->enable_multibyte_characters);
|
||||
|
||||
validate_region (&start, &end);
|
||||
CHECK_NUMBER (fromchar, 2);
|
||||
CHECK_NUMBER (tochar, 3);
|
||||
|
||||
if (! NILP (current_buffer->enable_multibyte_characters))
|
||||
if (multibyte_p)
|
||||
{
|
||||
len = CHAR_STRING (XFASTINT (fromchar), fromstr);
|
||||
if (CHAR_STRING (XFASTINT (tochar), tostr) != len)
|
||||
|
|
@ -2341,7 +2342,10 @@ Both characters must have the same length of multi-byte form.")
|
|||
stop = end_byte;
|
||||
}
|
||||
p = BYTE_POS_ADDR (pos_byte);
|
||||
INC_POS (pos_byte_next);
|
||||
if (multibyte_p)
|
||||
INC_POS (pos_byte_next);
|
||||
else
|
||||
++pos_byte_next;
|
||||
if (pos_byte_next - pos_byte == len
|
||||
&& p[0] == fromstr[0]
|
||||
&& (len == 1
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue