Mercurial > emacs
diff src/regex.c @ 95856:f13a77e0e34f
* character.h (CHAR_TO_BYTE_SAFE): New macro.
* character.c (Fmultibyte_char_to_unibyte): Obey the docstring.
* regex.c (RE_CHAR_TO_UNIBYTE): Use the new macro.
(WEAK_ALIAS): Simplify.
* syntax.c (skip_chars): Don't mark non-byte chars in the fastmap
when searching a unibyte buffer.
author | Stefan Monnier <monnier@iro.umontreal.ca> |
---|---|
date | Thu, 12 Jun 2008 20:25:47 +0000 |
parents | 9588c3703f38 |
children | e038c1a8307c |
line wrap: on
line diff
--- a/src/regex.c Thu Jun 12 17:28:00 2008 +0000 +++ b/src/regex.c Thu Jun 12 20:25:47 2008 +0000 @@ -153,10 +153,7 @@ # define RE_CHAR_TO_MULTIBYTE(c) unibyte_to_multibyte_table[(c)] -# define RE_CHAR_TO_UNIBYTE(c) \ - (ASCII_CHAR_P (c) ? (c) \ - : CHAR_BYTE8_P (c) ? CHAR_TO_BYTE8 (c) \ - : multibyte_char_to_unibyte_safe (c)) +# define RE_CHAR_TO_UNIBYTE(c) CHAR_TO_BYTE_SAFE (c) /* Set C a (possibly converted to multibyte) character before P. P points into a string which is the virtual concatenation of STR1 @@ -5574,10 +5571,7 @@ if (multibyte) { pat_ch = STRING_CHAR_AND_LENGTH (p, pend - p, pat_charlen); - if (CHAR_BYTE8_P (pat_ch)) - pat_ch = CHAR_TO_BYTE8 (pat_ch); - else - pat_ch = RE_CHAR_TO_UNIBYTE (pat_ch); + pat_ch = RE_CHAR_TO_UNIBYTE (pat_ch); } else {