diff options
| author | Andreas Schwab | 2008-08-27 10:56:15 +0000 |
|---|---|---|
| committer | Andreas Schwab | 2008-08-27 10:56:15 +0000 |
| commit | dafaabd183be9c7d8a7360f807e474c726c38a4c (patch) | |
| tree | a56a16d735a2ee27f7b1dac683335b3f98234f5e /src | |
| parent | ff37360cdc624035b85ca59ff0606c745b919c80 (diff) | |
| download | emacs-dafaabd183be9c7d8a7360f807e474c726c38a4c.tar.gz emacs-dafaabd183be9c7d8a7360f807e474c726c38a4c.zip | |
(search_buffer): Set char_base to zero only at the end.
Diffstat (limited to 'src')
| -rw-r--r-- | src/ChangeLog | 4 | ||||
| -rw-r--r-- | src/search.c | 16 |
2 files changed, 11 insertions, 9 deletions
diff --git a/src/ChangeLog b/src/ChangeLog index 259bc7f04ed..e345916a47f 100644 --- a/src/ChangeLog +++ b/src/ChangeLog | |||
| @@ -1,3 +1,7 @@ | |||
| 1 | 2008-08-27 Andreas Schwab <schwab@suse.de> | ||
| 2 | |||
| 3 | * search.c (search_buffer): Set char_base to zero only at the end. | ||
| 4 | |||
| 1 | 2008-08-27 Kenichi Handa <handa@m17n.org> | 5 | 2008-08-27 Kenichi Handa <handa@m17n.org> |
| 2 | 6 | ||
| 3 | * fileio.c (report_file_error): Fix handling of multibyte error | 7 | * fileio.c (report_file_error): Fix handling of multibyte error |
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, | |||
| 1340 | if (this_char_base > 0) | 1340 | if (this_char_base > 0) |
| 1341 | boyer_moore_ok = 0; | 1341 | boyer_moore_ok = 0; |
| 1342 | else | 1342 | else |
| 1343 | { | 1343 | this_char_base = 0; |
| 1344 | this_char_base = 0; | ||
| 1345 | if (char_base < 0) | ||
| 1346 | char_base = this_char_base; | ||
| 1347 | } | ||
| 1348 | } | 1344 | } |
| 1349 | else if (CHAR_BYTE8_P (inverse)) | 1345 | else if (CHAR_BYTE8_P (inverse)) |
| 1350 | /* Boyer-moore search can't handle a | 1346 | /* Boyer-moore search can't handle a |
| @@ -1356,8 +1352,7 @@ search_buffer (string, pos, pos_byte, lim, lim_byte, n, | |||
| 1356 | this_char_base = inverse & ~0x3F; | 1352 | this_char_base = inverse & ~0x3F; |
| 1357 | if (char_base < 0) | 1353 | if (char_base < 0) |
| 1358 | char_base = this_char_base; | 1354 | char_base = this_char_base; |
| 1359 | else if (char_base > 0 | 1355 | else if (this_char_base != char_base) |
| 1360 | && this_char_base != char_base) | ||
| 1361 | boyer_moore_ok = 0; | 1356 | boyer_moore_ok = 0; |
| 1362 | } | 1357 | } |
| 1363 | else if ((inverse & ~0x3F) != this_char_base) | 1358 | else if ((inverse & ~0x3F) != this_char_base) |
| @@ -1368,8 +1363,6 @@ search_buffer (string, pos, pos_byte, lim, lim_byte, n, | |||
| 1368 | } | 1363 | } |
| 1369 | } | 1364 | } |
| 1370 | } | 1365 | } |
| 1371 | if (char_base < 0) | ||
| 1372 | char_base = 0; | ||
| 1373 | 1366 | ||
| 1374 | /* Store this character into the translated pattern. */ | 1367 | /* Store this character into the translated pattern. */ |
| 1375 | bcopy (str, pat, charlen); | 1368 | bcopy (str, pat, charlen); |
| @@ -1377,6 +1370,11 @@ search_buffer (string, pos, pos_byte, lim, lim_byte, n, | |||
| 1377 | base_pat += in_charlen; | 1370 | base_pat += in_charlen; |
| 1378 | len_byte -= in_charlen; | 1371 | len_byte -= in_charlen; |
| 1379 | } | 1372 | } |
| 1373 | |||
| 1374 | /* If char_base is still negative we didn't find any translated | ||
| 1375 | non-ASCII characters. */ | ||
| 1376 | if (char_base < 0) | ||
| 1377 | char_base = 0; | ||
| 1380 | } | 1378 | } |
| 1381 | else | 1379 | else |
| 1382 | { | 1380 | { |