diff options
author | Andreas Schwab <schwab@suse.de> | 2008-08-27 10:56:15 +0000 |
---|---|---|
committer | Andreas Schwab <schwab@suse.de> | 2008-08-27 10:56:15 +0000 |
commit | dafaabd183be9c7d8a7360f807e474c726c38a4c (patch) | |
tree | a56a16d735a2ee27f7b1dac683335b3f98234f5e /src/search.c | |
parent | ff37360cdc624035b85ca59ff0606c745b919c80 (diff) | |
download | emacs-dafaabd183be9c7d8a7360f807e474c726c38a4c.tar.gz |
(search_buffer): Set char_base to zero only at the end.
Diffstat (limited to 'src/search.c')
-rw-r--r-- | src/search.c | 16 |
1 files changed, 7 insertions, 9 deletions
diff --git a/src/search.c b/src/search.c index 7bdb4ec07d2..df054434b63 100644 --- a/src/search.c +++ b/src/search.c @@ -1340,11 +1340,7 @@ search_buffer (string, pos, pos_byte, lim, lim_byte, n, if (this_char_base > 0) boyer_moore_ok = 0; else - { - this_char_base = 0; - if (char_base < 0) - char_base = this_char_base; - } + this_char_base = 0; } else if (CHAR_BYTE8_P (inverse)) /* Boyer-moore search can't handle a @@ -1356,8 +1352,7 @@ search_buffer (string, pos, pos_byte, lim, lim_byte, n, this_char_base = inverse & ~0x3F; if (char_base < 0) char_base = this_char_base; - else if (char_base > 0 - && this_char_base != char_base) + else if (this_char_base != char_base) boyer_moore_ok = 0; } else if ((inverse & ~0x3F) != this_char_base) @@ -1368,8 +1363,6 @@ search_buffer (string, pos, pos_byte, lim, lim_byte, n, } } } - if (char_base < 0) - char_base = 0; /* Store this character into the translated pattern. */ bcopy (str, pat, charlen); @@ -1377,6 +1370,11 @@ search_buffer (string, pos, pos_byte, lim, lim_byte, n, base_pat += in_charlen; len_byte -= in_charlen; } + + /* If char_base is still negative we didn't find any translated + non-ASCII characters. */ + if (char_base < 0) + char_base = 0; } else { |