source:
scripts/patches/bash-2.05b-gnu_fixes-2.patch@
4af05f3
Last change on this file since 4af05f3 was 7f65c0e, checked in by , 19 years ago | |
---|---|
|
|
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 1044 1044 } 1045 1045 else 1046 1046 { 1047 #define CMD_IS_DIR(x) (absolute_pathname(x) == 0 && *(x) != '~' && test_for_directory (x)) 1048 1047 1049 matches = rl_completion_matches (text, command_word_completion_function); 1050 1048 1051 /* If we are attempting command completion and nothing matches, we 1049 1052 do not want readline to perform filename completion for us. We 1050 1053 still want to be able to complete partial pathnames, so set the … … 1052 1055 filenames and leave directories in the match list. */ 1053 1056 if (matches == (char **)NULL) 1054 1057 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])) 1056 1059 /* Turn off rl_filename_completion_desired so readline doesn't 1057 1060 append a slash if there is a directory with the same name 1058 1061 in the current directory, or other filename-specific things. … … 1061 1064 looking in the current directory anyway, so there's no 1062 1065 conflict. */ 1063 1066 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])) 1065 1068 /* There are multiple instances of the same match (duplicate 1066 1069 completions haven't yet been removed). In this case, all of 1067 1070 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 311 311 mapped to something, `abc' to be mapped to something else, 312 312 and the function bound to `a' to be executed when the user 313 313 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)) 315 315 { 316 316 map[ANYOTHERKEY] = k; 317 317 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 70 70 static void cr PARAMS((void)); 71 71 72 72 #if defined (HANDLE_MULTIBYTE) 73 static int _rl_col_width PARAMS((c har *, int, int));73 static int _rl_col_width PARAMS((const char *, int, int)); 74 74 static int *_rl_wrapped_line; 75 75 #else 76 76 # define _rl_col_width(l, s, e) (((e) <= (s)) ? 0 : (e) - (s)) … … 1348 1348 { 1349 1349 _rl_output_some_chars (nfd + lendiff, temp - lendiff); 1350 1350 #if 0 1351 _rl_last_c_pos += _rl_col_width (nfd+lendiff, 0, temp-lendiff) - col_lendiff;1352 #else1353 1351 _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); 1354 1354 #endif 1355 1355 } 1356 1356 } … … 1510 1510 #if defined (HANDLE_MULTIBYTE) 1511 1511 /* If we have multibyte characters, NEW is indexed by the buffer point in 1512 1512 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; 1515 1522 #else 1516 1523 if (_rl_last_c_pos == new) return; 1517 1524 #endif … … 1594 1601 #endif 1595 1602 { 1596 1603 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)); 1602 1605 else 1603 1606 _rl_backspace (_rl_last_c_pos - new); 1604 1607 } … … 2117 2120 scan from the beginning of the string to take the state into account. */ 2118 2121 static int 2119 2122 _rl_col_width (str, start, end) 2120 c har *str;2123 const char *str; 2121 2124 int start, end; 2122 2125 { 2123 2126 wchar_t wc; … … 2193 2196 return width; 2194 2197 } 2195 2198 #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 205 205 if (tmp == (size_t)(-2)) 206 206 { 207 207 /* shorted to compose multibyte char */ 208 memset (ps, 0, sizeof(mbstate_t)); 208 if (ps) 209 memset (ps, 0, sizeof(mbstate_t)); 209 210 return -2; 210 211 } 211 212 else if (tmp == (size_t)(-1)) 212 213 { 213 214 /* invalid to compose multibyte char */ 214 215 /* initialize the conversion state */ 215 memset (ps, 0, sizeof(mbstate_t)); 216 if (ps) 217 memset (ps, 0, sizeof(mbstate_t)); 216 218 return -1; 217 219 } 218 220 else if (tmp == (size_t)0) … … 225 227 return 1. Otherwise return 0. */ 226 228 int 227 229 _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; 231 236 { 232 237 int i, w1, w2; 233 238 … … 276 281 pos++; 277 282 /* clear the state of the byte sequence, because 278 283 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)); 280 286 } 287 else if (tmp == 0) 288 pos++; 281 289 else 282 290 pos += tmp; 283 291 } -
lib/readline/readline.c
diff -Naur bash-2.05b/lib/readline/readline.c bash-2.05b-new/lib/readline/readline.c
old new 684 684 } 685 685 #if defined (VI_MODE) 686 686 if (rl_editing_mode == vi_mode && _rl_keymap == vi_movement_keymap && 687 key != ANYOTHERKEY && 687 688 _rl_vi_textmod_command (key)) 688 689 _rl_vi_set_last (key, rl_numeric_arg, rl_arg_sign); 689 690 #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 680 680 int count; 681 681 { 682 682 wchar_t wc; 683 char mb[MB_LEN_MAX]; 683 char mb[MB_LEN_MAX+1]; 684 int mblen; 684 685 mbstate_t ps; 685 686 686 687 memset (&ps, 0, sizeof (mbstate_t)); … … 703 704 /* Vi is kind of strange here. */ 704 705 if (wc) 705 706 { 706 wctomb (mb, wc); 707 mblen = wctomb (mb, wc); 708 if (mblen >= 0) 709 mb[mblen] = '\0'; 707 710 rl_begin_undo_group (); 708 711 rl_delete (1, 0); 709 712 rl_insert_text (mb); -
subst.c
diff -Naur bash-2.05b/subst.c bash-2.05b-new/subst.c
old new 1638 1638 1639 1639 /* This performs word splitting and quoted null character removal on 1640 1640 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) 1646 1645 1647 1646 WORD_LIST * 1648 1647 list_string (string, separators, quoted)
Note:
See TracBrowser
for help on using the repository browser.