source: patches/bash-2.05b-gnu_fixes-2.patch@ 0ee931e

clfs-1.2 clfs-2.1 clfs-3.0.0-systemd clfs-3.0.0-sysvinit systemd sysvinit
Last change on this file since 0ee931e was 617118d, checked in by Jim Gifford <clfs@…>, 19 years ago

r561@server (orig r559): root | 2005-06-05 02:38:49 -0700
Fixed Directory Structure

  • Property mode set to 100644
File size: 7.8 KB
  • bashline.c

    Submitted By: Jeremy Utley <jeremy@linuxfromscratch.org>
    Date: 2003-08-28
    Initial Package Version: 2.05b
    Origin: ftp://ftp.gnu.org/gnu/bash
    Description: Integrates all 7 published bash-2.05b patches into a single
                 patch file for LFS use.
    
    diff -Naur bash-2.05b/bashline.c bash-2.05b-new/bashline.c
    old new  
    10441044        }
    10451045      else
    10461046        {
     1047#define CMD_IS_DIR(x)   (absolute_pathname(x) == 0 && *(x) != '~' && test_for_directory (x))
     1048
    10471049          matches = rl_completion_matches (text, command_word_completion_function);
     1050
    10481051          /* If we are attempting command completion and nothing matches, we
    10491052             do not want readline to perform filename completion for us.  We
    10501053             still want to be able to complete partial pathnames, so set the
     
    10521055             filenames and leave directories in the match list. */
    10531056          if (matches == (char **)NULL)
    10541057            rl_ignore_some_completions_function = bash_ignore_filenames;
    1055           else if (matches[1] == 0 && *matches[0] != '/')
     1058          else if (matches[1] == 0 && CMD_IS_DIR(matches[0]))
    10561059            /* Turn off rl_filename_completion_desired so readline doesn't
    10571060               append a slash if there is a directory with the same name
    10581061               in the current directory, or other filename-specific things.
     
    10611064               looking in the current directory anyway, so there's no
    10621065               conflict. */
    10631066            rl_filename_completion_desired = 0;
    1064           else if (matches[0] && matches[1] && STREQ (matches[0], matches[1]) && *matches[0] != '/')
     1067          else if (matches[0] && matches[1] && STREQ (matches[0], matches[1]) && CMD_IS_DIR (matches[0]))
    10651068            /* There are multiple instances of the same match (duplicate
    10661069               completions haven't yet been removed).  In this case, all of
    10671070               the matches will be the same, and the duplicate removal code
  • lib/readline/bind.c

    diff -Naur bash-2.05b/lib/readline/bind.c bash-2.05b-new/lib/readline/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;
  • lib/readline/display.c

    diff -Naur bash-2.05b/lib/readline/display.c bash-2.05b-new/lib/readline/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          
  • lib/readline/mbutil.c

    diff -Naur bash-2.05b/lib/readline/mbutil.c bash-2.05b-new/lib/readline/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    }
  • lib/readline/readline.c

    diff -Naur bash-2.05b/lib/readline/readline.c bash-2.05b-new/lib/readline/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
  • lib/readline/vi_mode.c

    diff -Naur bash-2.05b/lib/readline/vi_mode.c bash-2.05b-new/lib/readline/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);
  • subst.c

    diff -Naur bash-2.05b/subst.c bash-2.05b-new/subst.c
    old new  
    16381638
    16391639/* This performs word splitting and quoted null character removal on
    16401640   STRING. */
    1641 #if 0
    1642 #define issep(c)        ((separators)[1] ? (member ((c), separators)) : (c) == (separators)[0])
    1643 #else
    1644 #define issep(c)        ((separators)[1] ? isifs(c) : (c) == (separators)[0])
    1645 #endif
     1641#define issep(c) \
     1642        (((separators)[0]) ? ((separators)[1] ? isifs(c) \
     1643                                              : (c) == (separators)[0]) \
     1644                           : 0)
    16461645
    16471646WORD_LIST *
    16481647list_string (string, separators, quoted)
Note: See TracBrowser for help on using the repository browser.