]> git.ipfire.org Git - people/pmueller/ipfire-2.x.git/blob - src/patches/ncurses-5.5-fixes-1.patch
Updated GeoIP database.
[people/pmueller/ipfire-2.x.git] / src / patches / ncurses-5.5-fixes-1.patch
1 Submitted by: Alexander E. Patrakov
2 Date: 2005-12-07
3 Initial Package Version: 5.5
4 Upstream Status: Backport
5 Origin: Cherry-picked from ftp://invisible-island.net/ncurses/5.5/*.gz
6 Description: Fixes the following bugs:
7
8 * memory leak in keyname()
9 * mishandling of overlapped wide characters, http://bugs.debian.org/316663
10 * problems with line-drawing characters on cygwin, http://bugs.debian.org/338234
11 * mishandling of EINTR in tcgetattr/tcsetattr, http://bugs.debian.org/339518
12 * mishandling of single-column multibyte characters, http://bugs.debian.org/341661
13
14 --- ncurses-5.5-20051015+/ncurses/base/MKkeyname.awk 2005-04-30 19:26:25.000000000 +0000
15 +++ ncurses-5.5-20051022/ncurses/base/MKkeyname.awk 2005-10-22 19:01:23.000000000 +0000
16 @@ -97,6 +97,7 @@
17 print " break;"
18 print " }"
19 print " }"
20 + print " free(bound);"
21 print " if (result != 0)"
22 print " break;"
23 print " }"
24 --- ncurses-5.5-20051022+/ncurses/base/lib_addch.c 2005-03-27 16:52:16.000000000 +0000
25 +++ ncurses-5.5-20051029/ncurses/base/lib_addch.c 2005-10-30 00:51:36.000000000 +0000
26 @@ -315,7 +315,7 @@
27 * setup though.
28 */
29 for (i = 0; i < len; ++i) {
30 - if (isWidecBase(win->_line[y].text[i])) {
31 + if (isWidecBase(win->_line[y].text[x + i])) {
32 break;
33 } else if (isWidecExt(win->_line[y].text[x + i])) {
34 for (j = i; x + j <= win->_maxx; ++j) {
35 @@ -334,7 +334,9 @@
36 for (i = 0; i < len; ++i) {
37 NCURSES_CH_T value = ch;
38 SetWidecExt(value, i);
39 - TR(TRACE_VIRTPUT, ("multicolumn %d:%d", i + 1, len));
40 + TR(TRACE_VIRTPUT, ("multicolumn %d:%d (%d,%d)",
41 + i + 1, len,
42 + win->_begy + y, win->_begx + x));
43 line->text[x] = value;
44 CHANGED_CELL(line, x);
45 ++x;
46 --- ncurses-5.5-20051022+/ncurses/base/lib_bkgd.c 2005-04-16 18:03:48.000000000 +0000
47 +++ ncurses-5.5-20051029/ncurses/base/lib_bkgd.c 2005-10-30 00:41:09.000000000 +0000
48 @@ -131,11 +131,11 @@
49
50 for (y = 0; y <= win->_maxy; y++) {
51 for (x = 0; x <= win->_maxx; x++) {
52 - if (CharEq(win->_line[y].text[x], old_bkgrnd))
53 + if (CharEq(win->_line[y].text[x], old_bkgrnd)) {
54 win->_line[y].text[x] = win->_nc_bkgd;
55 - else {
56 + } else {
57 NCURSES_CH_T wch = win->_line[y].text[x];
58 - RemAttr(wch, (~A_ALTCHARSET));
59 + RemAttr(wch, (~(A_ALTCHARSET | A_CHARTEXT)));
60 win->_line[y].text[x] = _nc_render(win, wch);
61 }
62 }
63 --- ncurses-5.5-20051022+/ncurses/base/lib_erase.c 2001-12-19 01:06:13.000000000 +0000
64 +++ ncurses-5.5-20051029/ncurses/base/lib_erase.c 2005-10-30 00:36:36.000000000 +0000
65 @@ -58,6 +59,24 @@
66 start = win->_line[y].text;
67 end = &start[win->_maxx];
68
69 + /*
70 + * If this is a derived window, we have to handle the case where
71 + * a multicolumn character extends into the window that we are
72 + * erasing.
73 + */
74 + if_WIDEC({
75 + if (isWidecExt(start[0])) {
76 + int x = (win->_parent != 0) ? (win->_begx) : 0;
77 + while (x-- > 0) {
78 + if (isWidecBase(start[-1])) {
79 + --start;
80 + break;
81 + }
82 + --start;
83 + }
84 + }
85 + });
86 +
87 for (sp = start; sp <= end; sp++)
88 *sp = blank;
89
90 --- ncurses-5.5-20051029+/misc/terminfo.src 2005-10-26 23:21:06.000000000 +0000
91 +++ ncurses-5.5-20051112/misc/terminfo.src 2005-11-12 23:01:03.000000000 +0000
92 @@ -4731,32 +4731,35 @@
93 # civis [make cursor invisible] causes everything to stackdump? \E[?25l\E[?1c
94 # ech [erase characters param] broken \E[%p1%dX
95 # kcbt [back-tab key] not implemented in cygwin? \E[Z
96 +#
97 +# 2005/11/12 -TD
98 +# Remove cbt since it does not work in current cygwin
99 +# Add 'mir' and 'in' flags based on tack
100 cygwin|ansi emulation for Cygwin,
101 - am, hs, in, msgr, xon,
102 + am, hs, mir, msgr, xon,
103 colors#8, it#8, pairs#64,
104 acsc=+\020\,\021-\030.^Y0\333`\004a\261f\370g\361h\260j\331k\277l\332m\300n\305o~p\304q\304r\304s_t\303u\264v\301w\302x\263y\363z\362{\343|\330}\234~\376,
105 - bel=^G, bold=\E[1m, cbt=\E[Z, clear=\E[H\E[J, cr=^M,
106 - cub=\E[%p1%dD, cub1=^H, cud=\E[%p1%dB, cud1=\E[B,
107 - cuf=\E[%p1%dC, cuf1=\E[C, cup=\E[%i%p1%d;%p2%dH,
108 - cuu=\E[%p1%dA, cuu1=\E[A, dch=\E[%p1%dP, dch1=\E[P,
109 - dl=\E[%p1%dM, dl1=\E[M, ed=\E[J, el=\E[K, el1=\E[1K, fsl=^G,
110 - home=\E[H, hpa=\E[%i%p1%dG, ht=^I, ich=\E[%p1%d@,
111 - ich1=\E[@, il=\E[%p1%dL, il1=\E[L, ind=^J, invis=\E[8m,
112 - kb2=\E[G, kbs=^H, kcub1=\E[D, kcud1=\E[B, kcuf1=\E[C,
113 - kcuu1=\E[A, kdch1=\E[3~, kend=\E[4~, kf1=\E[[A,
114 - kf10=\E[21~, kf11=\E[23~, kf12=\E[24~, kf13=\E[25~,
115 - kf14=\E[26~, kf15=\E[28~, kf16=\E[29~, kf17=\E[31~,
116 - kf18=\E[32~, kf19=\E[33~, kf2=\E[[B, kf20=\E[34~,
117 - kf3=\E[[C, kf4=\E[[D, kf5=\E[[E, kf6=\E[17~, kf7=\E[18~,
118 - kf8=\E[19~, kf9=\E[20~, khome=\E[1~, kich1=\E[2~,
119 - knp=\E[6~, kpp=\E[5~, kspd=^Z, nel=^M^J, op=\E[39;49m,
120 - rc=\E8, rev=\E[7m, ri=\EM, rmacs=\E[10m,
121 - rmcup=\E[2J\E[?47l\E8, rmir=\E[4l, rmpch=\E[10m,
122 - rmso=\E[27m, rmul=\E[24m, rs1=\Ec\E]R, sc=\E7,
123 - setab=\E[4%p1%dm, setaf=\E[3%p1%dm,
124 + bel=^G, bold=\E[1m, clear=\E[H\E[J, cr=^M, cub=\E[%p1%dD,
125 + cub1=^H, cud=\E[%p1%dB, cud1=\E[B, cuf=\E[%p1%dC,
126 + cuf1=\E[C, cup=\E[%i%p1%d;%p2%dH, cuu=\E[%p1%dA,
127 + cuu1=\E[A, dch=\E[%p1%dP, dch1=\E[P, dl=\E[%p1%dM,
128 + dl1=\E[M, ed=\E[J, el=\E[K, el1=\E[1K, fsl=^G, home=\E[H,
129 + hpa=\E[%i%p1%dG, ht=^I, ich=\E[%p1%d@, ich1=\E[@,
130 + il=\E[%p1%dL, il1=\E[L, ind=^J, invis=\E[8m, kb2=\E[G,
131 + kbs=^H, kcub1=\E[D, kcud1=\E[B, kcuf1=\E[C, kcuu1=\E[A,
132 + kdch1=\E[3~, kend=\E[4~, kf1=\E[[A, kf10=\E[21~,
133 + kf11=\E[23~, kf12=\E[24~, kf13=\E[25~, kf14=\E[26~,
134 + kf15=\E[28~, kf16=\E[29~, kf17=\E[31~, kf18=\E[32~,
135 + kf19=\E[33~, kf2=\E[[B, kf20=\E[34~, kf3=\E[[C, kf4=\E[[D,
136 + kf5=\E[[E, kf6=\E[17~, kf7=\E[18~, kf8=\E[19~, kf9=\E[20~,
137 + khome=\E[1~, kich1=\E[2~, knp=\E[6~, kpp=\E[5~, kspd=^Z,
138 + nel=^M^J, op=\E[39;49m, rc=\E8, rev=\E[7m, ri=\EM,
139 + rmacs=\E[10m, rmcup=\E[2J\E[?47l\E8, rmir=\E[4l,
140 + rmpch=\E[10m, rmso=\E[27m, rmul=\E[24m, rs1=\Ec\E]R,
141 + sc=\E7, setab=\E[4%p1%dm, setaf=\E[3%p1%dm,
142 sgr=\E[0;10%?%p1%t;7%;%?%p2%t;4%;%?%p3%t;7%;%?%p4%t;5%;%?%p6%t;1%;%?%p7%t;8%;%?%p9%t;11%;m,
143 - sgr0=\E[0;10m, smacs=\E11m, smcup=\E7\E[?47h, smir=\E[4h,
144 - smpch=\E[11m, smso=\E[7m, smul=\E[4m, tsl=\E];,
145 + sgr0=\E[0;10m, smacs=\E[11m, smcup=\E7\E[?47h,
146 + smir=\E[4h, smpch=\E[11m, smso=\E[7m, smul=\E[4m, tsl=\E];,
147 u6=\E[%i%d;%dR, u7=\E[6n, u8=\E[?6c, u9=\E[c,
148 vpa=\E[%i%p1%dd,
149
150 --- ncurses-5.5-20051112+/ncurses/tinfo/lib_ttyflags.c 2003-05-17 23:50:37.000000000 +0000
151 +++ ncurses-5.5-20051119/ncurses/tinfo/lib_ttyflags.c 2005-11-19 20:36:23.000000000 +0000
152 @@ -59,28 +59,51 @@
153 NCURSES_EXPORT(int)
154 _nc_get_tty_mode(TTY * buf)
155 {
156 - if (cur_term == 0
157 - || GET_TTY(cur_term->Filedes, buf) != 0) {
158 - memset(buf, 0, sizeof(*buf));
159 - return (ERR);
160 + int result = OK;
161 +
162 + if (cur_term == 0) {
163 + result = ERR;
164 + } else {
165 + for (;;) {
166 + if (GET_TTY(cur_term->Filedes, buf) != 0) {
167 + if (errno == EINTR)
168 + continue;
169 + result = ERR;
170 + }
171 + break;
172 + }
173 }
174 +
175 + if (result == ERR)
176 + memset(buf, 0, sizeof(*buf));
177 +
178 TR(TRACE_BITS, ("_nc_get_tty_mode(%d): %s",
179 cur_term->Filedes, _nc_trace_ttymode(buf)));
180 - return (OK);
181 + return (result);
182 }
183
184 NCURSES_EXPORT(int)
185 _nc_set_tty_mode(TTY * buf)
186 {
187 - if (cur_term == 0
188 - || SET_TTY(cur_term->Filedes, buf) != 0) {
189 - if ((errno == ENOTTY) && (SP != 0))
190 - SP->_notty = TRUE;
191 - return (ERR);
192 + int result = OK;
193 +
194 + if (cur_term == 0) {
195 + result = ERR;
196 + } else {
197 + for (;;) {
198 + if (SET_TTY(cur_term->Filedes, buf) != 0) {
199 + if (errno == EINTR)
200 + continue;
201 + if ((errno == ENOTTY) && (SP != 0))
202 + SP->_notty = TRUE;
203 + result = ERR;
204 + }
205 + break;
206 + }
207 }
208 TR(TRACE_BITS, ("_nc_set_tty_mode(%d): %s",
209 cur_term->Filedes, _nc_trace_ttymode(buf)));
210 - return (OK);
211 + return (result);
212 }
213
214 NCURSES_EXPORT(int)
215 --- ncurses-5.5-20051126+/ncurses/widechar/lib_ins_wch.c 2005-09-17 19:25:13.000000000 +0000
216 +++ ncurses-5.5-20051203/ncurses/widechar/lib_ins_wch.c 2005-12-03 20:24:19.000000000 +0000
217 @@ -117,7 +117,7 @@
218 for (cp = wstr; *cp && ((cp - wstr) < n); cp++) {
219 int len = wcwidth(*cp);
220
221 - if (len != 1) {
222 + if (len != 1 || !is8bits(*cp)) {
223 cchar_t tmp_cchar;
224 wchar_t tmp_wchar = *cp;
225 memset(&tmp_cchar, 0, sizeof(tmp_cchar));