BASH PATCH REPORT ================= Bash-Release: 3.2 Patch-ID: bash32-050 Bug-Reported-by: Jan Hnatek Bug-Reference-ID: <4A44991F.8010005@sun.com> Bug-Reference-URL: http://lists.gnu.org/archive/html/bug-bash/2009-06/msg00084.html 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-06-16 11:26:50.000000000 -0400 --- lib/readline/mbutil.c 2009-01-04 14:32:33.000000000 -0500 *************** *** 132,141 **** { tmp = mbrtowc (&wc, string + point, strlen (string + point), &ps); ! while (tmp > 0 && wcwidth (wc) == 0) { point += tmp; tmp = mbrtowc (&wc, string + point, strlen (string + point), &ps); - if (MB_NULLWCH (tmp) || MB_INVALIDCH (tmp)) - break; } } --- 130,137 ---- { tmp = mbrtowc (&wc, string + point, strlen (string + point), &ps); ! while (MB_NULLWCH (tmp) == 0 && MB_INVALIDCH (tmp) == 0 && wcwidth (wc) == 0) { point += tmp; tmp = mbrtowc (&wc, string + point, strlen (string + point), &ps); } } *** ../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 49 #endif /* _PATCHLEVEL_H_ */ --- 26,30 ---- looks for to find the patch level (for the sccs version string). */ ! #define PATCHLEVEL 50 #endif /* _PATCHLEVEL_H_ */