source: scripts/patches/readline-4.3-gnu_fixes-1.patch@ 9d5bb4a

clfs-1.2 clfs-2.1 clfs-3.0.0-systemd clfs-3.0.0-sysvinit systemd sysvinit
Last change on this file since 9d5bb4a 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
RevLine 
[617118d]1Submitted By: Jeremy Utley (jeremy@linuxfromscratch.org)
2Date: 2003-11-20
3Inital Package Version: 4.3
4Origin: GNU archive (http://ftp.gnu.org/gnu/readline/readline-4.3-patches)
5Description: Conglomeration of the 5 posted GNU patches to the Readline
6 4.3 source code.
7
8diff -Naur readline-4.3/bind.c readline-4.3-new/bind.c
9--- readline-4.3/bind.c 2002-01-24 16:15:52.000000000 +0000
10+++ readline-4.3-new/bind.c 2003-11-20 06:35:07.000000000 +0000
11@@ -311,7 +311,7 @@
12 mapped to something, `abc' to be mapped to something else,
13 and the function bound to `a' to be executed when the user
14 types `abx', leaving `bx' in the input queue. */
15- if (k.function /* && k.type == ISFUNC */)
16+ if (k.function && ((k.type == ISFUNC && k.function != rl_do_lowercase_version) || k.type == ISMACR))
17 {
18 map[ANYOTHERKEY] = k;
19 k.function = 0;
20diff -Naur readline-4.3/display.c readline-4.3-new/display.c
21--- readline-4.3/display.c 2002-06-04 14:54:47.000000000 +0000
22+++ readline-4.3-new/display.c 2003-11-20 06:35:07.000000000 +0000
23@@ -70,7 +70,7 @@
24 static void cr PARAMS((void));
25
26 #if defined (HANDLE_MULTIBYTE)
27-static int _rl_col_width PARAMS((char *, int, int));
28+static int _rl_col_width PARAMS((const char *, int, int));
29 static int *_rl_wrapped_line;
30 #else
31 # define _rl_col_width(l, s, e) (((e) <= (s)) ? 0 : (e) - (s))
32@@ -1348,9 +1348,9 @@
33 {
34 _rl_output_some_chars (nfd + lendiff, temp - lendiff);
35 #if 0
36- _rl_last_c_pos += _rl_col_width (nfd+lendiff, 0, temp-lendiff) - col_lendiff;
37-#else
38 _rl_last_c_pos += _rl_col_width (nfd+lendiff, 0, temp-col_lendiff);
39+#else
40+ _rl_last_c_pos += _rl_col_width (nfd+lendiff, 0, temp-lendiff);
41 #endif
42 }
43 }
44@@ -1510,8 +1510,15 @@
45 #if defined (HANDLE_MULTIBYTE)
46 /* If we have multibyte characters, NEW is indexed by the buffer point in
47 a multibyte string, but _rl_last_c_pos is the display position. In
48- this case, NEW's display position is not obvious. */
49- if ((MB_CUR_MAX == 1 || rl_byte_oriented ) && _rl_last_c_pos == new) return;
50+ this case, NEW's display position is not obvious and must be
51+ calculated. */
52+ if (MB_CUR_MAX == 1 || rl_byte_oriented)
53+ {
54+ if (_rl_last_c_pos == new)
55+ return;
56+ }
57+ else if (_rl_last_c_pos == _rl_col_width (data, 0, new))
58+ return;
59 #else
60 if (_rl_last_c_pos == new) return;
61 #endif
62@@ -1594,11 +1601,7 @@
63 #endif
64 {
65 if (MB_CUR_MAX > 1 && rl_byte_oriented == 0)
66- {
67- tputs (_rl_term_cr, 1, _rl_output_character_function);
68- for (i = 0; i < new; i++)
69- putc (data[i], rl_outstream);
70- }
71+ _rl_backspace (_rl_last_c_pos - _rl_col_width (data, 0, new));
72 else
73 _rl_backspace (_rl_last_c_pos - new);
74 }
75@@ -2117,7 +2120,7 @@
76 scan from the beginning of the string to take the state into account. */
77 static int
78 _rl_col_width (str, start, end)
79- char *str;
80+ const char *str;
81 int start, end;
82 {
83 wchar_t wc;
84@@ -2193,4 +2196,3 @@
85 return width;
86 }
87 #endif /* HANDLE_MULTIBYTE */
88-
89diff -Naur readline-4.3/mbutil.c readline-4.3-new/mbutil.c
90--- readline-4.3/mbutil.c 2002-06-04 15:54:29.000000000 +0000
91+++ readline-4.3-new/mbutil.c 2003-11-20 06:35:07.000000000 +0000
92@@ -205,14 +205,16 @@
93 if (tmp == (size_t)(-2))
94 {
95 /* shorted to compose multibyte char */
96- memset (ps, 0, sizeof(mbstate_t));
97+ if (ps)
98+ memset (ps, 0, sizeof(mbstate_t));
99 return -2;
100 }
101 else if (tmp == (size_t)(-1))
102 {
103 /* invalid to compose multibyte char */
104 /* initialize the conversion state */
105- memset (ps, 0, sizeof(mbstate_t));
106+ if (ps)
107+ memset (ps, 0, sizeof(mbstate_t));
108 return -1;
109 }
110 else if (tmp == (size_t)0)
111@@ -225,9 +227,12 @@
112 return 1. Otherwise return 0. */
113 int
114 _rl_compare_chars (buf1, pos1, ps1, buf2, pos2, ps2)
115- char *buf1, *buf2;
116- mbstate_t *ps1, *ps2;
117- int pos1, pos2;
118+ char *buf1;
119+ int pos1;
120+ mbstate_t *ps1;
121+ char *buf2;
122+ int pos2;
123+ mbstate_t *ps2;
124 {
125 int i, w1, w2;
126
127@@ -276,8 +281,11 @@
128 pos++;
129 /* clear the state of the byte sequence, because
130 in this case effect of mbstate is undefined */
131- memset (ps, 0, sizeof (mbstate_t));
132+ if (ps)
133+ memset (ps, 0, sizeof (mbstate_t));
134 }
135+ else if (tmp == 0)
136+ pos++;
137 else
138 pos += tmp;
139 }
140diff -Naur readline-4.3/readline.c readline-4.3-new/readline.c
141--- readline-4.3/readline.c 2002-03-13 22:10:46.000000000 +0000
142+++ readline-4.3-new/readline.c 2003-11-20 06:35:07.000000000 +0000
143@@ -684,6 +684,7 @@
144 }
145 #if defined (VI_MODE)
146 if (rl_editing_mode == vi_mode && _rl_keymap == vi_movement_keymap &&
147+ key != ANYOTHERKEY &&
148 _rl_vi_textmod_command (key))
149 _rl_vi_set_last (key, rl_numeric_arg, rl_arg_sign);
150 #endif
151diff -Naur readline-4.3/vi_mode.c readline-4.3-new/vi_mode.c
152--- readline-4.3/vi_mode.c 2002-05-23 17:27:58.000000000 +0000
153+++ readline-4.3-new/vi_mode.c 2003-11-20 06:35:07.000000000 +0000
154@@ -680,7 +680,8 @@
155 int count;
156 {
157 wchar_t wc;
158- char mb[MB_LEN_MAX];
159+ char mb[MB_LEN_MAX+1];
160+ int mblen;
161 mbstate_t ps;
162
163 memset (&ps, 0, sizeof (mbstate_t));
164@@ -703,7 +704,9 @@
165 /* Vi is kind of strange here. */
166 if (wc)
167 {
168- wctomb (mb, wc);
169+ mblen = wctomb (mb, wc);
170+ if (mblen >= 0)
171+ mb[mblen] = '\0';
172 rl_begin_undo_group ();
173 rl_delete (1, 0);
174 rl_insert_text (mb);
Note: See TracBrowser for help on using the repository browser.