BASH PATCH REPORT
                            =================

Bash-Release: 3.2
Patch-ID: bash32-049

Bug-Reported-by:        Len Lattanzi <[email protected]>
Bug-Reference-ID:       <[email protected]>
Bug-Reference-URL:

Bug-Description:

On systems where mbrtowc() returns -2 when passed a length argument with
value 0, when using a multibyte locale, Readline's emacs-mode forward-char
at the end of a line will leave the point beyond the end of the line.

Patch:

*** ../bash-3.2-patched/lib/readline/mbutil.c   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))
       {
*** ../bash-3.2/patchlevel.h    Thu Apr 13 08:31:04 2006
--- patchlevel.h        Mon Oct 16 14:22:54 2006
***************
*** 26,30 ****
    looks for to find the patch level (for the sccs version string). */

! #define PATCHLEVEL 48

 #endif /* _PATCHLEVEL_H_ */
--- 26,30 ----
    looks for to find the patch level (for the sccs version string). */

! #define PATCHLEVEL 49

 #endif /* _PATCHLEVEL_H_ */