# HG changeset patch # User Andreas Schwab # Date 1219834575 0 # Node ID 99656f6b55ce66a42c0de1811025ecdc76ae728f # Parent fe0432f437b6c9d316990d76bc0c4888e95817c2 (search_buffer): Set char_base to zero only at the end. diff -r fe0432f437b6 -r 99656f6b55ce src/ChangeLog --- a/src/ChangeLog Wed Aug 27 07:32:00 2008 +0000 +++ b/src/ChangeLog Wed Aug 27 10:56:15 2008 +0000 @@ -1,3 +1,7 @@ +2008-08-27 Andreas Schwab + + * search.c (search_buffer): Set char_base to zero only at the end. + 2008-08-27 Kenichi Handa * fileio.c (report_file_error): Fix handling of multibyte error diff -r fe0432f437b6 -r 99656f6b55ce src/search.c --- a/src/search.c Wed Aug 27 07:32:00 2008 +0000 +++ b/src/search.c Wed Aug 27 10:56:15 2008 +0000 @@ -1340,11 +1340,7 @@ 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 @@ 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 @@ } } } - if (char_base < 0) - char_base = 0; /* Store this character into the translated pattern. */ bcopy (str, pat, charlen); @@ -1377,6 +1370,11 @@ 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 {