[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: bash-3.2 multibyte behavior on Solaris
From: |
Chet Ramey |
Subject: |
Re: bash-3.2 multibyte behavior on Solaris |
Date: |
Fri, 29 May 2009 23:13:46 -0400 |
User-agent: |
Thunderbird 2.0.0.21 (Macintosh/20090302) |
Jan Hnatek wrote:
> Hi,
>
> bash-3.2 on Solaris is suffering from the following bug:
> http://defect.opensolaris.org/bz/show_bug.cgi?id=3743
> (bash hangs sometimes when navigating with the arrow keys)
The problem is that different implementations of mbrtowc return different
values when `n' is 0. Try this patch; it fixes that underlying problem.
Chet
--
``The lyf so short, the craft so long to lerne.'' - Chaucer
Chet Ramey, ITS, CWRU chet@case.edu http://cnswww.cns.cwru.edu/~chet/
*** lib/readline/mbutil.c.orig 2009-05-29 23:09:26.000000000 -0400
--- lib/readline/mbutil.c 2009-05-29 23:10:12.000000000 -0400
***************
*** 78,82 ****
int seed, count, find_non_zero;
{
! size_t tmp;
mbstate_t ps;
int point;
--- 78,82 ----
int seed, count, find_non_zero;
{
! size_t tmp, len;
mbstate_t ps;
int point;
***************
*** 99,103 ****
while (count > 0)
{
! tmp = mbrtowc (&wc, string+point, strlen(string + point), &ps);
if (MB_INVALIDCH ((size_t)tmp))
{
--- 99,106 ----
while (count > 0)
{
! len = strlen (string + point);
! if (len == 0)
! break;
! tmp = mbrtowc (&wc, string+point, len, &ps);
if (MB_INVALIDCH ((size_t)tmp))
{