bug-readline
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Bug-readline] Readline-5.2 Official Patch 14


From: Chet Ramey
Subject: [Bug-readline] Readline-5.2 Official Patch 14
Date: Thu, 18 Jun 2009 17:42:00 -0400

                           READLINE PATCH REPORT
                           =====================

Readline-Release: 5.2
Patch-ID: readline52-014

Bug-Reported-by:        Len Lattanzi <address@hidden>
Bug-Reference-ID:       <address@hidden>
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:

*** ../readline-5.2-patched/mbutil.c    2009-05-29 23:09:26.000000000 -0400
--- 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))
        {

-- 
``The lyf so short, the craft so long to lerne.'' - Chaucer

Chet Ramey, ITS, CWRU    address@hidden    http://tiswww.tis.case.edu/~chet/




reply via email to

[Prev in Thread] Current Thread [Next in Thread]