bug-bash
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH] isearch: fix with HANDLE_MULTIBYTE && LC_ALL=C


From: Grisha Levit
Subject: [PATCH] isearch: fix with HANDLE_MULTIBYTE && LC_ALL=C
Date: Fri, 18 Oct 2024 19:04:54 -0400

Sorry, previous patch should have been:
---
 lib/readline/isearch.c | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/lib/readline/isearch.c b/lib/readline/isearch.c
index 9ddf9ce3..c6d8c8a8 100644
--- a/lib/readline/isearch.c
+++ b/lib/readline/isearch.c
@@ -742,10 +742,11 @@ opcode_dispatch:
     /* Add character to search string and continue search. */
     default:
 #if defined (HANDLE_MULTIBYTE)
-      wlen = (cxt->mb[0] == 0 || cxt->mb[1] == 0) ? 1 : RL_STRLEN (cxt->mb);
-#else
-      wlen = 1;
+      if (MB_CUR_MAX > 1 && rl_byte_oriented == 0)
+       wlen = (cxt->mb[0] == 0 || cxt->mb[1] == 0) ? 1 : RL_STRLEN (cxt->mb);
+      else
 #endif
+       wlen = 1;
       if (cxt->search_string_index + wlen + 1 >= cxt->search_string_size)
        {
          cxt->search_string_size += 128;       /* 128 much greater than 
MB_CUR_MAX */
-- 
2.47.0




reply via email to

[Prev in Thread] Current Thread [Next in Thread]