]>
Commit | Line | Data |
---|---|---|
e5ec3c9c ER |
1 | BASH PATCH REPORT |
2 | ================= | |
3 | ||
4 | Bash-Release: 4.2 | |
5 | Patch-ID: bash42-036 | |
6 | ||
7 | Bug-Reported-by: gregrwm <backuppc-users@whitleymott.net> | |
8 | Bug-Reference-ID: <CAD+dB9B4JG+qUwZBQUwiQmVt0j6NDn=DDTxr9R+nkA8DL4KLJA@mail.gmail.com> | |
9 | Bug-Reference-URL: http://lists.gnu.org/archive/html/bug-bash/2012-05/msg00108.html | |
10 | ||
11 | Bug-Description: | |
12 | ||
13 | Bash-4.2 produces incorrect word splitting results when expanding | |
14 | double-quoted $@ in the same string as and adjacent to other variable | |
15 | expansions. The $@ should be split, the other expansions should not. | |
16 | ||
17 | Patch (apply with `patch -p0'): | |
18 | ||
19 | *** ../bash-4.2-patched/subst.c 2012-05-02 12:02:33.000000000 -0400 | |
20 | --- subst.c 2012-07-08 21:19:32.000000000 -0400 | |
21 | *************** | |
22 | *** 7923,7927 **** | |
23 | /* State flags */ | |
24 | int had_quoted_null; | |
25 | ! int has_dollar_at; | |
26 | int tflag; | |
27 | int pflags; /* flags passed to param_expand */ | |
28 | --- 7923,7927 ---- | |
29 | /* State flags */ | |
30 | int had_quoted_null; | |
31 | ! int has_dollar_at, temp_has_dollar_at; | |
32 | int tflag; | |
33 | int pflags; /* flags passed to param_expand */ | |
34 | *************** | |
35 | *** 8128,8138 **** | |
36 | *expanded_something = 1; | |
37 | ||
38 | ! has_dollar_at = 0; | |
39 | pflags = (word->flags & W_NOCOMSUB) ? PF_NOCOMSUB : 0; | |
40 | if (word->flags & W_NOSPLIT2) | |
41 | pflags |= PF_NOSPLIT2; | |
42 | tword = param_expand (string, &sindex, quoted, expanded_something, | |
43 | ! &has_dollar_at, "ed_dollar_at, | |
44 | &had_quoted_null, pflags); | |
45 | ||
46 | if (tword == &expand_wdesc_error || tword == &expand_wdesc_fatal) | |
47 | --- 8128,8139 ---- | |
48 | *expanded_something = 1; | |
49 | ||
50 | ! temp_has_dollar_at = 0; | |
51 | pflags = (word->flags & W_NOCOMSUB) ? PF_NOCOMSUB : 0; | |
52 | if (word->flags & W_NOSPLIT2) | |
53 | pflags |= PF_NOSPLIT2; | |
54 | tword = param_expand (string, &sindex, quoted, expanded_something, | |
55 | ! &temp_has_dollar_at, "ed_dollar_at, | |
56 | &had_quoted_null, pflags); | |
57 | + has_dollar_at += temp_has_dollar_at; | |
58 | ||
59 | if (tword == &expand_wdesc_error || tword == &expand_wdesc_fatal) | |
60 | *************** | |
61 | *** 8275,8281 **** | |
62 | temp = (char *)NULL; | |
63 | ||
64 | ! has_dollar_at = 0; | |
65 | /* Need to get W_HASQUOTEDNULL flag through this function. */ | |
66 | ! list = expand_word_internal (tword, Q_DOUBLE_QUOTES, 0, &has_dollar_at, (int *)NULL); | |
67 | ||
68 | if (list == &expand_word_error || list == &expand_word_fatal) | |
69 | --- 8276,8283 ---- | |
70 | temp = (char *)NULL; | |
71 | ||
72 | ! temp_has_dollar_at = 0; /* XXX */ | |
73 | /* Need to get W_HASQUOTEDNULL flag through this function. */ | |
74 | ! list = expand_word_internal (tword, Q_DOUBLE_QUOTES, 0, &temp_has_dollar_at, (int *)NULL); | |
75 | ! has_dollar_at += temp_has_dollar_at; | |
76 | ||
77 | if (list == &expand_word_error || list == &expand_word_fatal) | |
78 | *** ../bash-4.2-patched/patchlevel.h Sat Jun 12 20:14:48 2010 | |
79 | --- patchlevel.h Thu Feb 24 21:41:34 2011 | |
80 | *************** | |
81 | *** 26,30 **** | |
82 | looks for to find the patch level (for the sccs version string). */ | |
83 | ||
84 | ! #define PATCHLEVEL 35 | |
85 | ||
86 | #endif /* _PATCHLEVEL_H_ */ | |
87 | --- 26,30 ---- | |
88 | looks for to find the patch level (for the sccs version string). */ | |
89 | ||
90 | ! #define PATCHLEVEL 36 | |
91 | ||
92 | #endif /* _PATCHLEVEL_H_ */ |