diff options
| author | Kenichi Handa | 2002-05-07 12:46:21 +0000 |
|---|---|---|
| committer | Kenichi Handa | 2002-05-07 12:46:21 +0000 |
| commit | b9e5a425cdab595e309f1c260d30855a53e50bc1 (patch) | |
| tree | c76074657538e810ceb2775d5802bb463d7e4f67 /src | |
| parent | e4ac82404fedf328fcaf2faf60a3e15c0a75f872 (diff) | |
| download | emacs-b9e5a425cdab595e309f1c260d30855a53e50bc1.tar.gz emacs-b9e5a425cdab595e309f1c260d30855a53e50bc1.zip | |
(boyer_moore): Fix handling of mulitbyte character translation.
Diffstat (limited to 'src')
| -rw-r--r-- | src/search.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/src/search.c b/src/search.c index 746463fe0a1..5ce999ef4d7 100644 --- a/src/search.c +++ b/src/search.c | |||
| @@ -1639,8 +1639,9 @@ boyer_moore (n, base_pat, len, len_byte, trt, inverse_trt, | |||
| 1639 | this_translated = 0; | 1639 | this_translated = 0; |
| 1640 | } | 1640 | } |
| 1641 | 1641 | ||
| 1642 | if (ch > 0400) | 1642 | if (this_translated |
| 1643 | j = ((unsigned char) ch) | 0200; | 1643 | && ch >= 0200) |
| 1644 | j = (ch & 0x3F) | 0200; | ||
| 1644 | else | 1645 | else |
| 1645 | j = (unsigned char) ch; | 1646 | j = (unsigned char) ch; |
| 1646 | 1647 | ||
| @@ -1657,8 +1658,8 @@ boyer_moore (n, base_pat, len, len_byte, trt, inverse_trt, | |||
| 1657 | while (1) | 1658 | while (1) |
| 1658 | { | 1659 | { |
| 1659 | TRANSLATE (ch, inverse_trt, ch); | 1660 | TRANSLATE (ch, inverse_trt, ch); |
| 1660 | if (ch > 0400) | 1661 | if (ch > 0200) |
| 1661 | j = ((unsigned char) ch) | 0200; | 1662 | j = (ch & 0x3F) | 0200; |
| 1662 | else | 1663 | else |
| 1663 | j = (unsigned char) ch; | 1664 | j = (unsigned char) ch; |
| 1664 | 1665 | ||