Jan Hnatek wrote:
> Hi Chet,
>
> unfortunately, there's additional problem with bash
> multibyte behavior, which is specific to sparc.
>
> When using bash patch level <49 on sparc in multibyte,
> pressing right arrow at the end of the line moves
> the cursor one character left.
>
> When using bash patch level 49 on sparc in multibyte,
> pressing right arrow at the end of the line moves
> the cursor two characters left.
>
> Attached patch does remove the issue, but may
> not be the core problem... I'd be grateful for
> comments.
>
> Thanks & regards,
> hnhn
>
>
> --- bash-3.2/lib/readline/mbutil.c.orig Thu Jun 25 08:34:51 2009
> +++ bash-3.2/lib/readline/mbutil.c Thu Jun 25 08:36:51 2009
> @@ -128,7 +128,7 @@
> }
> }
>
> - if (find_non_zero)
> + if (find_non_zero && len)
> {
> tmp = mbrtowc (&wc, string + point, strlen (string + point), &ps);
> while (tmp > 0 && wcwidth (wc) == 0)
>
So what does the Solaris mbrtowc return in this case? The flow of that
particular section of code isn't that great (bash-4.0 is better), but it
seems to me that point can only increase. If mbrtowc returns -2, the
loop won't be entered at all.
Chet
--
``The lyf so short, the craft so long to lerne.'' - Chaucer
Chet Ramey, ITS, CWRU [email protected] http://cnswww.cns.cwru.edu/~chet/