Official patches 001-005

PR:             62555
This commit is contained in:
Andrey A. Chernov 2004-02-10 20:17:58 +00:00
parent bc816461b7
commit 8d9b29bec1
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=125665

View File

@ -1,3 +1,4 @@
/* $FreeBSD$ */
/* vi_mode.c -- A vi emulation mode for Bash.
Derived from code written by Jeff Sparkes (jsparkes@bnr.ca). */
@ -680,7 +681,8 @@ _rl_vi_change_mbchar_case (count)
int count;
{
wchar_t wc;
char mb[MB_LEN_MAX];
char mb[MB_LEN_MAX+1];
int mblen;
mbstate_t ps;
memset (&ps, 0, sizeof (mbstate_t));
@ -703,7 +705,9 @@ _rl_vi_change_mbchar_case (count)
/* Vi is kind of strange here. */
if (wc)
{
wctomb (mb, wc);
mblen = wctomb (mb, wc);
if (mblen >= 0)
mb[mblen] = '\0';
rl_begin_undo_group ();
rl_delete (1, 0);
rl_insert_text (mb);