Path: csiph.com!aioe.org!news.glorb.com!usenet.stanford.edu!not-for-mail From: e est Newsgroups: gnu.bash.bug Subject: Re: reverse-i-search, multibyte backspace problem Date: Sun, 19 Jul 2015 04:25:16 +0200 Lines: 70 Approved: bug-bash@gnu.org Message-ID: References: <274381437250999@web18h.yandex.ru> <20150719015352.GA32433@ma.sdf.org> NNTP-Posting-Host: lists.gnu.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Trace: usenet.stanford.edu 1437272726 9778 208.118.235.17 (19 Jul 2015 02:25:26 GMT) X-Complaints-To: action@cs.stanford.edu Cc: "bug-bash@gnu.org" To: =?utf-8?B?RWR1YXJkbyBBLiBCdXN0YW1hbnRlIEzDs3Bleg==?= Envelope-to: bug-bash@gnu.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yandex.com; s=mail; t=1437272717; bh=TzXF56ZigbTF3qbm1McX0Y+nTL1mQidvwhPECidOLiM=; h=From:To:Cc:In-Reply-To:References:Subject:Date; b=UCiJ97kJx8PesgVSjDhXp5H3FVoNV+QhphpEuXpLp1pCkAckXOEKEsLzacmtn3T3Z reZgkUC3+V92npUQ5hzuEvJEW38i+3Qg5o/l6a8j9BSS9YO6LtDN6o/R4OpgQUieXP FFwzmE4CHmcnGx1Ml53qtVS97jusBxEPsF+Dt3W8= In-Reply-To: <20150719015352.GA32433@ma.sdf.org> X-Mailer: Yamail [ http://yandex.ru ] 5.0 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 5.255.216.137 X-BeenThere: bug-bash@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Bug reports for the GNU Bourne Again SHell List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Xref: aioe.org gnu.bash.bug:11237 Hello, Thanks for pointing out the fix. I've tried the "devel" branch, and could= n't reproduce the bug there. Sorry for the disturbance, I should have checked whether the master branc= h really represents the bleeding edge of development. 19.07.2015, 03:53, "Eduardo A. Bustamante L=C3=B3pez" = : > Hello, > > Can you please try the 'devel' branch? > > There's a fix for this issue already in it: > > | commit 947f04912e4715e7a9df526cd99412bffa729368 > | Author: Chet Ramey > | 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 > > This was reported earlier this year: > > =C2=A0=C2=A0http://lists.gnu.org/archive/html/bug-readline/2015-01/msg0= 0017.html > > Or use this to patch: > > | dualbus@yaqui ...src/gnu/bash % git diff origin/master 947f04912e4715= e7a9df526cd99412bffa729368 -- 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 =3D=3D 0) > | rl_ding (); > | - else > | + else if (MB_CUR_MAX =3D=3D 1 || rl_byte_oriented) > | cxt->search_string[--cxt->search_string_index] =3D '\0'; > | + else > | + { > | + wstart =3D _rl_find_prev_mbchar (cxt->search_string, cxt->search_st= ring_index, MB_FIND_NONZERO); > | + if (wstart >=3D 0) > | + cxt->search_string[cxt->search_string_index =3D wstart] =3D '\0'; > | + else > | + rl_ding (); > | + } > | break; > | > | case -4: /* C-G, abort */ > > Greetings! > > -- > Eduardo Bustamante > https://dualbus.me/