source: scripts/patches/readline-4.3-gnu_fixes-1.patch@ 75bc092

clfs-1.2 clfs-2.1 clfs-3.0.0-systemd clfs-3.0.0-sysvinit systemd sysvinit
Last change on this file since 75bc092 was 7f65c0e, checked in by Jim Gifford <clfs@…>, 19 years ago

r625@server (orig r623): jim | 2005-10-31 12:43:24 -0800
Final Move

  • Property mode set to 100644
File size: 5.3 KB
  • readline-4.

    Submitted By: Jeremy Utley (jeremy@linuxfromscratch.org)
    Date: 2003-11-20
    Inital Package Version: 4.3
    Origin: GNU archive (http://ftp.gnu.org/gnu/readline/readline-4.3-patches)
    Description: Conglomeration of the 5 posted GNU patches to the Readline
                 4.3 source code.
    
    diff -Naur readline-4.3/bind.c readline-4.3-new/bind.c
    old new  
    311311             mapped to something, `abc' to be mapped to something else,
    312312             and the function bound  to `a' to be executed when the user
    313313             types `abx', leaving `bx' in the input queue. */
    314           if (k.function /* && k.type == ISFUNC */)
     314          if (k.function && ((k.type == ISFUNC && k.function != rl_do_lowercase_version) || k.type == ISMACR))
    315315            {
    316316              map[ANYOTHERKEY] = k;
    317317              k.function = 0;
  • readline-4.

    diff -Naur readline-4.3/display.c readline-4.3-new/display.c
    old new  
    7070static void cr PARAMS((void));
    7171
    7272#if defined (HANDLE_MULTIBYTE)
    73 static int _rl_col_width PARAMS((char *, int, int));
     73static int _rl_col_width PARAMS((const char *, int, int));
    7474static int *_rl_wrapped_line;
    7575#else
    7676#  define _rl_col_width(l, s, e)        (((e) <= (s)) ? 0 : (e) - (s))
     
    13481348            {
    13491349              _rl_output_some_chars (nfd + lendiff, temp - lendiff);
    13501350#if 0
    1351               _rl_last_c_pos += _rl_col_width (nfd+lendiff, 0, temp-lendiff) - col_lendiff;
    1352 #else
    13531351              _rl_last_c_pos += _rl_col_width (nfd+lendiff, 0, temp-col_lendiff);
     1352#else
     1353              _rl_last_c_pos += _rl_col_width (nfd+lendiff, 0, temp-lendiff);
    13541354#endif
    13551355            }
    13561356        }
     
    15101510#if defined (HANDLE_MULTIBYTE)
    15111511  /* If we have multibyte characters, NEW is indexed by the buffer point in
    15121512     a multibyte string, but _rl_last_c_pos is the display position.  In
    1513      this case, NEW's display position is not obvious. */
    1514   if ((MB_CUR_MAX == 1 || rl_byte_oriented ) && _rl_last_c_pos == new) return;
     1513     this case, NEW's display position is not obvious and must be
     1514     calculated. */
     1515  if (MB_CUR_MAX == 1 || rl_byte_oriented)
     1516    {
     1517      if (_rl_last_c_pos == new)
     1518        return;
     1519    }
     1520  else if (_rl_last_c_pos == _rl_col_width (data, 0, new))
     1521    return;
    15151522#else
    15161523  if (_rl_last_c_pos == new) return;
    15171524#endif
     
    15941601#endif
    15951602    {
    15961603      if (MB_CUR_MAX > 1 && rl_byte_oriented == 0)
    1597         {
    1598           tputs (_rl_term_cr, 1, _rl_output_character_function);
    1599           for (i = 0; i < new; i++)
    1600             putc (data[i], rl_outstream);
    1601         }
     1604        _rl_backspace (_rl_last_c_pos - _rl_col_width (data, 0, new));
    16021605      else
    16031606        _rl_backspace (_rl_last_c_pos - new);
    16041607    }
     
    21172120   scan from the beginning of the string to take the state into account. */
    21182121static int
    21192122_rl_col_width (str, start, end)
    2120      char *str;
     2123     const char *str;
    21212124     int start, end;
    21222125{
    21232126  wchar_t wc;
     
    21932196  return width;
    21942197}
    21952198#endif /* HANDLE_MULTIBYTE */
    2196          
  • readline-4.

    diff -Naur readline-4.3/mbutil.c readline-4.3-new/mbutil.c
    old new  
    205205  if (tmp == (size_t)(-2))
    206206    {
    207207      /* shorted to compose multibyte char */
    208       memset (ps, 0, sizeof(mbstate_t));
     208      if (ps)
     209        memset (ps, 0, sizeof(mbstate_t));
    209210      return -2;
    210211    }
    211212  else if (tmp == (size_t)(-1))
    212213    {
    213214      /* invalid to compose multibyte char */
    214215      /* initialize the conversion state */
    215       memset (ps, 0, sizeof(mbstate_t));
     216      if (ps)
     217        memset (ps, 0, sizeof(mbstate_t));
    216218      return -1;
    217219    }
    218220  else if (tmp == (size_t)0)
     
    225227   return 1. Otherwise return 0. */
    226228int
    227229_rl_compare_chars (buf1, pos1, ps1, buf2, pos2, ps2)
    228      char *buf1, *buf2;
    229      mbstate_t *ps1, *ps2;
    230      int pos1, pos2;
     230     char *buf1;
     231     int pos1;
     232     mbstate_t *ps1;
     233     char *buf2;
     234     int pos2;
     235     mbstate_t *ps2;
    231236{
    232237  int i, w1, w2;
    233238
     
    276281          pos++;
    277282          /* clear the state of the byte sequence, because
    278283             in this case effect of mbstate is undefined  */
    279           memset (ps, 0, sizeof (mbstate_t));
     284          if (ps)
     285            memset (ps, 0, sizeof (mbstate_t));
    280286        }
     287      else if (tmp == 0)
     288        pos++;
    281289      else
    282290        pos += tmp;
    283291    }
  • readline.c

    diff -Naur readline-4.3/readline.c readline-4.3-new/readline.c
    old new  
    684684    }
    685685#if defined (VI_MODE)
    686686  if (rl_editing_mode == vi_mode && _rl_keymap == vi_movement_keymap &&
     687      key != ANYOTHERKEY &&
    687688      _rl_vi_textmod_command (key))
    688689    _rl_vi_set_last (key, rl_numeric_arg, rl_arg_sign);
    689690#endif
  • readline-4.

    diff -Naur readline-4.3/vi_mode.c readline-4.3-new/vi_mode.c
    old new  
    680680     int count;
    681681{
    682682  wchar_t wc;
    683   char mb[MB_LEN_MAX];
     683  char mb[MB_LEN_MAX+1];
     684  int mblen;
    684685  mbstate_t ps;
    685686
    686687  memset (&ps, 0, sizeof (mbstate_t));
     
    703704      /* Vi is kind of strange here. */
    704705      if (wc)
    705706        {
    706           wctomb (mb, wc);
     707          mblen = wctomb (mb, wc);
     708          if (mblen >= 0)
     709            mb[mblen] = '\0';
    707710          rl_begin_undo_group ();
    708711          rl_delete (1, 0);
    709712          rl_insert_text (mb);
Note: See TracBrowser for help on using the repository browser.