bug-bash
[Top][All Lists]
Advanced

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

Re: reverse-i-search, multibyte backspace problem


From: e est
Subject: Re: reverse-i-search, multibyte backspace problem
Date: Sun, 19 Jul 2015 04:25:16 +0200

Hello,

Thanks for pointing out the fix. I've tried the "devel" branch, and couldn't 
reproduce the bug there.

Sorry for the disturbance, I should have checked whether the master branch 
really represents the bleeding edge of development.

19.07.2015, 03:53, "Eduardo A. Bustamante López" <address@hidden>:
> Hello,
>
> Can you please try the 'devel' branch?
>
> There's a fix for this issue already in it:
>
> | commit 947f04912e4715e7a9df526cd99412bffa729368
> | Author: Chet Ramey <address@hidden>
> | Date: Tue Jan 27 11:10:49 2015 -0500
> |
> | commit bash-20150116 snapshot
>
> Here's the description of the fix:
>
> | lib/readline/isearch.c
> | - _rl_isearch_dispatch: if we are in a multibyte locale, make sure to use
> | _rl_find_prev_mbchar when trying to delete characters from the search
> | string, instead of just chopping off the previous byte. Fixes bug
> | reported by Kyrylo Shpytsya <address@hidden>
>
> This was reported earlier this year:
>
>   http://lists.gnu.org/archive/html/bug-readline/2015-01/msg00017.html
>
> Or use this to patch:
>
> | address@hidden ...src/gnu/bash % git diff origin/master 
> 947f04912e4715e7a9df526cd99412bffa729368 -- lib/readline/isearch.c
> | diff --git a/lib/readline/isearch.c b/lib/readline/isearch.c
> | index 6f6a7a6..d768560 100644
> | --- a/lib/readline/isearch.c
> | +++ b/lib/readline/isearch.c
> | @@ -553,8 +553,16 @@ add_character:
> | do until we have a real isearch-undo. */
> | if (cxt->search_string_index == 0)
> | rl_ding ();
> | - else
> | + else if (MB_CUR_MAX == 1 || rl_byte_oriented)
> | cxt->search_string[--cxt->search_string_index] = '\0';
> | + else
> | + {
> | + wstart = _rl_find_prev_mbchar (cxt->search_string, 
> cxt->search_string_index, MB_FIND_NONZERO);
> | + if (wstart >= 0)
> | + cxt->search_string[cxt->search_string_index = wstart] = '\0';
> | + else
> | + rl_ding ();
> | + }
> | break;
> |
> | case -4: /* C-G, abort */
>
> Greetings!
>
> --
> Eduardo Bustamante
> https://dualbus.me/



reply via email to

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