source:
scripts/patches/readline-4.3-gnu_fixes-1.patch@
0547e59
Last change on this file since 0547e59 was 7f65c0e, checked in by , 19 years ago | |
---|---|
|
|
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 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; -
readline-4.
diff -Naur readline-4.3/display.c readline-4.3-new/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 -
readline-4.
diff -Naur readline-4.3/mbutil.c readline-4.3-new/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 } -
readline.c
diff -Naur readline-4.3/readline.c readline-4.3-new/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 -
readline-4.
diff -Naur readline-4.3/vi_mode.c readline-4.3-new/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);
Note:
See TracBrowser
for help on using the repository browser.