source: patches/readline-5.2-fixes-2.patch@ ff103efa

clfs-1.2 clfs-2.1 clfs-3.0.0-systemd clfs-3.0.0-sysvinit systemd sysvinit
Last change on this file since ff103efa was 4232f0e, checked in by Joe Ciccone <jciccone@…>, 17 years ago

Updated the readline fixes patch.

  • Property mode set to 100644
File size: 3.3 KB
  • readline-5.2

    Submitted By: Joe Ciccone <jciccone@gmail.com>
    Date: 2007-07-23
    Initial Package Version: 5.2
    Origin: ftp://ftp.cwru.edu/pub/bash/readline-5.2-patches
    Upstream Status: From Upstream
    Description: Contains patches 001 - 004 from upstream
    
    diff -Naur readline-5.2.orig/display.c readline-5.2/display.c
    old new  
    561561      wrap_offset = prompt_invis_chars_first_line = 0;
    562562    }
    563563
     564#if defined (HANDLE_MULTIBYTE)
     565#define CHECK_INV_LBREAKS() \
     566      do { \
     567        if (newlines >= (inv_lbsize - 2)) \
     568          { \
     569            inv_lbsize *= 2; \
     570            inv_lbreaks = (int *)xrealloc (inv_lbreaks, inv_lbsize * sizeof (int)); \
     571            _rl_wrapped_line = (int *)xrealloc (_rl_wrapped_line, inv_lbsize * sizeof (int)); \
     572          } \
     573      } while (0)
     574#else
    564575#define CHECK_INV_LBREAKS() \
    565576      do { \
    566577        if (newlines >= (inv_lbsize - 2)) \
     
    569580            inv_lbreaks = (int *)xrealloc (inv_lbreaks, inv_lbsize * sizeof (int)); \
    570581          } \
    571582      } while (0)
     583#endif /* HANDLE_MULTIBYTE */
    572584
    573585#if defined (HANDLE_MULTIBYTE)   
    574586#define CHECK_LPOS() \
     
    15861598          temp = nls - nfd;
    15871599          if (temp > 0)
    15881600            {
     1601              /* If nfd begins at the prompt, or before the invisible
     1602                 characters in the prompt, we need to adjust _rl_last_c_pos
     1603                 in a multibyte locale to account for the wrap offset and
     1604                 set cpos_adjusted accordingly. */
    15891605              _rl_output_some_chars (nfd, temp);
    1590               _rl_last_c_pos += _rl_col_width (nfd, 0, temp);;
     1606              if (MB_CUR_MAX > 1 && rl_byte_oriented == 0)
     1607                {
     1608                  _rl_last_c_pos += _rl_col_width (nfd, 0, temp);
     1609                  if (current_line == 0 && wrap_offset &&  ((nfd - new) <= prompt_last_invisible))
     1610                    {
     1611                      _rl_last_c_pos -= wrap_offset;
     1612                      cpos_adjusted = 1;
     1613                    }
     1614                }
     1615              else
     1616                _rl_last_c_pos += temp;
    15911617            }
    15921618        }
    15931619      /* Otherwise, print over the existing material. */
     
    15951621        {
    15961622          if (temp > 0)
    15971623            {
     1624              /* If nfd begins at the prompt, or before the invisible
     1625                 characters in the prompt, we need to adjust _rl_last_c_pos
     1626                 in a multibyte locale to account for the wrap offset and
     1627                 set cpos_adjusted accordingly. */
    15981628              _rl_output_some_chars (nfd, temp);
    15991629              _rl_last_c_pos += col_temp;               /* XXX */
     1630              if (MB_CUR_MAX > 1 && rl_byte_oriented == 0)
     1631                {
     1632                  if (current_line == 0 && wrap_offset &&  ((nfd - new) <= prompt_last_invisible))
     1633                    {
     1634                      _rl_last_c_pos -= wrap_offset;
     1635                      cpos_adjusted = 1;
     1636                    }
     1637                }
    16001638            }
    16011639          lendiff = (oe - old) - (ne - new);
    16021640          if (MB_CUR_MAX > 1 && rl_byte_oriented == 0)
     
    17321770  if (MB_CUR_MAX > 1 && rl_byte_oriented == 0)
    17331771    {
    17341772      dpos = _rl_col_width (data, 0, new);
    1735       if (dpos > prompt_last_invisible)         /* XXX - don't use woff here */
     1773      /* Use NEW when comparing against the last invisible character in the
     1774         prompt string, since they're both buffer indices and DPOS is a
     1775         desired display position. */
     1776      if (new > prompt_last_invisible)          /* XXX - don't use woff here */
    17361777        {
    17371778          dpos -= woff;
    17381779          /* Since this will be assigned to _rl_last_c_pos at the end (more
     
    23802421
    23812422  if (end <= start)
    23822423    return 0;
     2424  if (MB_CUR_MAX == 1 || rl_byte_oriented)
     2425    return (end - start);
    23832426
    23842427  memset (&ps, 0, sizeof (mbstate_t));
    23852428
Note: See TracBrowser for help on using the repository browser.