c = STRING_CHAR_AND_LENGTH (base_pat, len_byte, in_charlen);
- /* If we are searching for something strange,
- an invalid multibyte code, don't use boyer-moore. */
- if (! ASCII_BYTE_P (c))
- boyer_moore_ok = 0;
-
/* Translate the character, if requested. */
TRANSLATE (translated, trt, c);
/* If translation changed the byte-length, go back
charlen = CHAR_STRING (c, workbuf, str);
}
+ /* If we are searching for something strange,
+ an invalid multibyte code, don't use boyer-moore. */
+ if (! ASCII_BYTE_P (translated)
+ && (charlen == 1 /* 8bit code */
+ || charlen != in_charlen /* invalid multibyte code */
+ ))
+ boyer_moore_ok = 0;
+
TRANSLATE (inverse, inverse_trt, c);
/* Did this char actually get translated?
{
/* Keep track of which character set row
contains the characters that need translation. */
- int charset_base_code = c & ~0xff;
+ int charset_base_code = c & ~CHAR_FIELD3_MASK;
if (charset_base == -1)
charset_base = charset_base_code;
else if (charset_base != charset_base_code)