summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorRichard M. Stallman <rms@gnu.org>1999-01-06 22:46:20 +0000
committerRichard M. Stallman <rms@gnu.org>1999-01-06 22:46:20 +0000
commit5ffaf437c9e3f3cae356631f16ee7c2bf6830202 (patch)
tree6b74150f522fa000f18d8e217af047d1ab9298d4 /src
parentd3d4fb62475009b5620806a78dadb1063970379d (diff)
downloademacs-5ffaf437c9e3f3cae356631f16ee7c2bf6830202.tar.gz
(search_buffer): Fix previous change.
Diffstat (limited to 'src')
-rw-r--r--src/search.c15
1 files changed, 9 insertions, 6 deletions
diff --git a/src/search.c b/src/search.c
index fee6b835bd3..8a67360b549 100644
--- a/src/search.c
+++ b/src/search.c
@@ -1205,11 +1205,6 @@ search_buffer (string, pos, pos_byte, lim, lim_byte, n,
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
@@ -1221,6 +1216,14 @@ search_buffer (string, pos, pos_byte, lim, lim_byte, n,
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?
@@ -1229,7 +1232,7 @@ search_buffer (string, pos, pos_byte, lim, lim_byte, n,
{
/* 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)