From b9e5a425cdab595e309f1c260d30855a53e50bc1 Mon Sep 17 00:00:00 2001 From: Kenichi Handa Date: Tue, 7 May 2002 12:46:21 +0000 Subject: [PATCH] (boyer_moore): Fix handling of mulitbyte character translation. --- src/search.c | 9 +++++---- 1 file 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, this_translated = 0; } - if (ch > 0400) - j = ((unsigned char) ch) | 0200; + if (this_translated + && ch >= 0200) + j = (ch & 0x3F) | 0200; else j = (unsigned char) ch; @@ -1657,8 +1658,8 @@ boyer_moore (n, base_pat, len, len_byte, trt, inverse_trt, while (1) { TRANSLATE (ch, inverse_trt, ch); - if (ch > 0400) - j = ((unsigned char) ch) | 0200; + if (ch > 0200) + j = (ch & 0x3F) | 0200; else j = (unsigned char) ch; -- 2.39.5