aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorRichard M. Stallman1999-01-06 22:46:20 +0000
committerRichard M. Stallman1999-01-06 22:46:20 +0000
commit5ffaf437c9e3f3cae356631f16ee7c2bf6830202 (patch)
tree6b74150f522fa000f18d8e217af047d1ab9298d4 /src
parentd3d4fb62475009b5620806a78dadb1063970379d (diff)
downloademacs-5ffaf437c9e3f3cae356631f16ee7c2bf6830202.tar.gz
emacs-5ffaf437c9e3f3cae356631f16ee7c2bf6830202.zip
(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,
1205 1205
1206 c = STRING_CHAR_AND_LENGTH (base_pat, len_byte, in_charlen); 1206 c = STRING_CHAR_AND_LENGTH (base_pat, len_byte, in_charlen);
1207 1207
1208 /* If we are searching for something strange,
1209 an invalid multibyte code, don't use boyer-moore. */
1210 if (! ASCII_BYTE_P (c))
1211 boyer_moore_ok = 0;
1212
1213 /* Translate the character, if requested. */ 1208 /* Translate the character, if requested. */
1214 TRANSLATE (translated, trt, c); 1209 TRANSLATE (translated, trt, c);
1215 /* If translation changed the byte-length, go back 1210 /* If translation changed the byte-length, go back
@@ -1221,6 +1216,14 @@ search_buffer (string, pos, pos_byte, lim, lim_byte, n,
1221 charlen = CHAR_STRING (c, workbuf, str); 1216 charlen = CHAR_STRING (c, workbuf, str);
1222 } 1217 }
1223 1218
1219 /* If we are searching for something strange,
1220 an invalid multibyte code, don't use boyer-moore. */
1221 if (! ASCII_BYTE_P (translated)
1222 && (charlen == 1 /* 8bit code */
1223 || charlen != in_charlen /* invalid multibyte code */
1224 ))
1225 boyer_moore_ok = 0;
1226
1224 TRANSLATE (inverse, inverse_trt, c); 1227 TRANSLATE (inverse, inverse_trt, c);
1225 1228
1226 /* Did this char actually get translated? 1229 /* Did this char actually get translated?
@@ -1229,7 +1232,7 @@ search_buffer (string, pos, pos_byte, lim, lim_byte, n,
1229 { 1232 {
1230 /* Keep track of which character set row 1233 /* Keep track of which character set row
1231 contains the characters that need translation. */ 1234 contains the characters that need translation. */
1232 int charset_base_code = c & ~0xff; 1235 int charset_base_code = c & ~CHAR_FIELD3_MASK;
1233 if (charset_base == -1) 1236 if (charset_base == -1)
1234 charset_base = charset_base_code; 1237 charset_base = charset_base_code;
1235 else if (charset_base != charset_base_code) 1238 else if (charset_base != charset_base_code)