Official patches 001-005
PR: 62555
This commit is contained in:
parent
1859bb7c05
commit
1fcbd5275d
@ -1,3 +1,4 @@
|
|||||||
|
/* $FreeBSD$ */
|
||||||
/* vi_mode.c -- A vi emulation mode for Bash.
|
/* vi_mode.c -- A vi emulation mode for Bash.
|
||||||
Derived from code written by Jeff Sparkes (jsparkes@bnr.ca). */
|
Derived from code written by Jeff Sparkes (jsparkes@bnr.ca). */
|
||||||
|
|
||||||
@ -680,7 +681,8 @@ _rl_vi_change_mbchar_case (count)
|
|||||||
int count;
|
int count;
|
||||||
{
|
{
|
||||||
wchar_t wc;
|
wchar_t wc;
|
||||||
char mb[MB_LEN_MAX];
|
char mb[MB_LEN_MAX+1];
|
||||||
|
int mblen;
|
||||||
mbstate_t ps;
|
mbstate_t ps;
|
||||||
|
|
||||||
memset (&ps, 0, sizeof (mbstate_t));
|
memset (&ps, 0, sizeof (mbstate_t));
|
||||||
@ -703,7 +705,9 @@ _rl_vi_change_mbchar_case (count)
|
|||||||
/* Vi is kind of strange here. */
|
/* Vi is kind of strange here. */
|
||||||
if (wc)
|
if (wc)
|
||||||
{
|
{
|
||||||
wctomb (mb, wc);
|
mblen = wctomb (mb, wc);
|
||||||
|
if (mblen >= 0)
|
||||||
|
mb[mblen] = '\0';
|
||||||
rl_begin_undo_group ();
|
rl_begin_undo_group ();
|
||||||
rl_delete (1, 0);
|
rl_delete (1, 0);
|
||||||
rl_insert_text (mb);
|
rl_insert_text (mb);
|
||||||
|
Loading…
Reference in New Issue
Block a user