]>
Commit | Line | Data |
---|---|---|
888cf725 | 1 | BASH PATCH REPORT |
2 | ================= | |
3 | ||
4 | Bash-Release: 2.05b | |
5 | Patch-ID: bash205b-005 | |
6 | ||
7 | Bug-Reported-by: Jim Meyering <jim@meyering.net> | |
8 | Bug-Reference-ID: <87bs6v8iib.fsf@pixie.eng.ascend.com> | |
9 | Bug-Reference-URL: http://mail.gnu.org/archive/html/bug-bash/2002-09/msg00047.html | |
10 | ||
11 | Bug-Description: | |
12 | ||
13 | When in a locale with multibyte characters, the readline display updater | |
14 | will occasionally cause a segmentation fault when attempting to compute | |
15 | the length of the first multibyte character on the line. | |
16 | ||
17 | Patch: | |
18 | ||
19 | *** ../bash-2.05b/lib/readline/mbutil.c Tue Jun 4 11:54:29 2002 | |
20 | --- lib/readline/mbutil.c Mon Aug 5 11:20:39 2002 | |
21 | *************** | |
22 | *** 206,210 **** | |
23 | { | |
24 | /* shorted to compose multibyte char */ | |
25 | ! memset (ps, 0, sizeof(mbstate_t)); | |
26 | return -2; | |
27 | } | |
28 | --- 206,211 ---- | |
29 | { | |
30 | /* shorted to compose multibyte char */ | |
31 | ! if (ps) | |
32 | ! memset (ps, 0, sizeof(mbstate_t)); | |
33 | return -2; | |
34 | } | |
35 | *************** | |
36 | *** 213,217 **** | |
37 | /* invalid to compose multibyte char */ | |
38 | /* initialize the conversion state */ | |
39 | ! memset (ps, 0, sizeof(mbstate_t)); | |
40 | return -1; | |
41 | } | |
42 | --- 214,219 ---- | |
43 | /* invalid to compose multibyte char */ | |
44 | /* initialize the conversion state */ | |
45 | ! if (ps) | |
46 | ! memset (ps, 0, sizeof(mbstate_t)); | |
47 | return -1; | |
48 | } | |
49 | *************** | |
50 | *** 226,232 **** | |
51 | int | |
52 | _rl_compare_chars (buf1, pos1, ps1, buf2, pos2, ps2) | |
53 | ! char *buf1, *buf2; | |
54 | ! mbstate_t *ps1, *ps2; | |
55 | ! int pos1, pos2; | |
56 | { | |
57 | int i, w1, w2; | |
58 | --- 228,237 ---- | |
59 | int | |
60 | _rl_compare_chars (buf1, pos1, ps1, buf2, pos2, ps2) | |
61 | ! char *buf1; | |
62 | ! int pos1; | |
63 | ! mbstate_t *ps1; | |
64 | ! char *buf2; | |
65 | ! int pos2; | |
66 | ! mbstate_t *ps2; | |
67 | { | |
68 | int i, w1, w2; | |
69 | *************** | |
70 | *** 277,282 **** | |
71 | /* clear the state of the byte sequence, because | |
72 | in this case effect of mbstate is undefined */ | |
73 | ! memset (ps, 0, sizeof (mbstate_t)); | |
74 | } | |
75 | else | |
76 | pos += tmp; | |
77 | --- 282,290 ---- | |
78 | /* clear the state of the byte sequence, because | |
79 | in this case effect of mbstate is undefined */ | |
80 | ! if (ps) | |
81 | ! memset (ps, 0, sizeof (mbstate_t)); | |
82 | } | |
83 | + else if (tmp == 0) | |
84 | + pos++; | |
85 | else | |
86 | pos += tmp; |