]> git.eshelyaron.com Git - emacs.git/commitdiff
(search_buffer): Set char_base to zero only at the end.
authorAndreas Schwab <schwab@suse.de>
Wed, 27 Aug 2008 10:56:15 +0000 (10:56 +0000)
committerAndreas Schwab <schwab@suse.de>
Wed, 27 Aug 2008 10:56:15 +0000 (10:56 +0000)
src/ChangeLog
src/search.c

index 259bc7f04edf89089af6d730f5d12940957f3f12..e345916a47f7071dd78763d8044f24f0d6b7f92e 100644 (file)
@@ -1,3 +1,7 @@
+2008-08-27  Andreas Schwab  <schwab@suse.de>
+
+       * search.c (search_buffer): Set char_base to zero only at the end.
+
 2008-08-27  Kenichi Handa  <handa@m17n.org>
 
        * fileio.c (report_file_error): Fix handling of multibyte error
index 7bdb4ec07d22e418e043dfddb52756e25ed0afcd..df054434b635ebebc465c36130afc6e0a8bfb49d 100644 (file)
@@ -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
        {