]>
Commit | Line | Data |
---|---|---|
bd03fb8f AM |
1 | BASH PATCH REPORT |
2 | ================= | |
3 | ||
4 | Bash-Release: 4.0 | |
5 | Patch-ID: bash40-013 | |
6 | ||
7 | Bug-Reported-by: jidanni@jidanni.org | |
8 | Bug-Reference-ID: | |
9 | Bug-Reference-URL: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=519165 | |
10 | ||
11 | Bug-Description: | |
12 | ||
13 | Though references to $@ when there are no positional parameters will now | |
14 | cause the shell to exit if the `errexit' option has been enabled, constructs | |
15 | such as ${@:-foo} should not cause an exit. | |
16 | ||
17 | Patch: | |
18 | ||
19 | *** ../bash-4.0-patched/subst.c 2009-03-08 21:24:39.000000000 -0400 | |
20 | --- subst.c 2009-03-14 19:04:10.000000000 -0400 | |
21 | *************** | |
22 | *** 86,89 **** | |
23 | --- 86,90 ---- | |
24 | /* Flags for the `pflags' argument to param_expand() */ | |
25 | #define PF_NOCOMSUB 0x01 /* Do not perform command substitution */ | |
26 | + #define PF_IGNUNBOUND 0x02 /* ignore unbound vars even if -u set */ | |
27 | ||
28 | /* These defs make it easier to use the editor. */ | |
29 | *************** | |
30 | *** 264,268 **** | |
31 | static int chk_arithsub __P((const char *, int)); | |
32 | ||
33 | ! static WORD_DESC *parameter_brace_expand_word __P((char *, int, int)); | |
34 | static WORD_DESC *parameter_brace_expand_indir __P((char *, int, int, int *, int *)); | |
35 | static WORD_DESC *parameter_brace_expand_rhs __P((char *, char *, int, int, int *, int *)); | |
36 | --- 265,269 ---- | |
37 | static int chk_arithsub __P((const char *, int)); | |
38 | ||
39 | ! static WORD_DESC *parameter_brace_expand_word __P((char *, int, int, int)); | |
40 | static WORD_DESC *parameter_brace_expand_indir __P((char *, int, int, int *, int *)); | |
41 | static WORD_DESC *parameter_brace_expand_rhs __P((char *, char *, int, int, int *, int *)); | |
42 | *************** | |
43 | *** 5196,5202 **** | |
44 | NAME was found inside of a double-quoted expression. */ | |
45 | static WORD_DESC * | |
46 | ! parameter_brace_expand_word (name, var_is_special, quoted) | |
47 | char *name; | |
48 | ! int var_is_special, quoted; | |
49 | { | |
50 | WORD_DESC *ret; | |
51 | --- 5197,5203 ---- | |
52 | NAME was found inside of a double-quoted expression. */ | |
53 | static WORD_DESC * | |
54 | ! parameter_brace_expand_word (name, var_is_special, quoted, pflags) | |
55 | char *name; | |
56 | ! int var_is_special, quoted, pflags; | |
57 | { | |
58 | WORD_DESC *ret; | |
59 | *************** | |
60 | *** 5230,5234 **** | |
61 | ||
62 | ret = param_expand (tt, &sindex, quoted, (int *)NULL, (int *)NULL, | |
63 | ! (int *)NULL, (int *)NULL, 0); | |
64 | free (tt); | |
65 | } | |
66 | --- 5231,5235 ---- | |
67 | ||
68 | ret = param_expand (tt, &sindex, quoted, (int *)NULL, (int *)NULL, | |
69 | ! (int *)NULL, (int *)NULL, pflags); | |
70 | free (tt); | |
71 | } | |
72 | *************** | |
73 | *** 5291,5295 **** | |
74 | WORD_DESC *w; | |
75 | ||
76 | ! w = parameter_brace_expand_word (name, var_is_special, quoted); | |
77 | t = w->word; | |
78 | /* Have to dequote here if necessary */ | |
79 | --- 5292,5296 ---- | |
80 | WORD_DESC *w; | |
81 | ||
82 | ! w = parameter_brace_expand_word (name, var_is_special, quoted, PF_IGNUNBOUND); | |
83 | t = w->word; | |
84 | /* Have to dequote here if necessary */ | |
85 | *************** | |
86 | *** 5308,5312 **** | |
87 | return (WORD_DESC *)NULL; | |
88 | ||
89 | ! w = parameter_brace_expand_word (t, SPECIAL_VAR(t, 0), quoted); | |
90 | free (t); | |
91 | ||
92 | --- 5309,5313 ---- | |
93 | return (WORD_DESC *)NULL; | |
94 | ||
95 | ! w = parameter_brace_expand_word (t, SPECIAL_VAR(t, 0), quoted, 0); | |
96 | free (t); | |
97 | ||
98 | *************** | |
99 | *** 6659,6663 **** | |
100 | tdesc = parameter_brace_expand_indir (name + 1, var_is_special, quoted, quoted_dollar_atp, contains_dollar_at); | |
101 | else | |
102 | ! tdesc = parameter_brace_expand_word (name, var_is_special, quoted); | |
103 | ||
104 | if (tdesc) | |
105 | --- 6660,6664 ---- | |
106 | tdesc = parameter_brace_expand_indir (name + 1, var_is_special, quoted, quoted_dollar_atp, contains_dollar_at); | |
107 | else | |
108 | ! tdesc = parameter_brace_expand_word (name, var_is_special, quoted, PF_IGNUNBOUND); | |
109 | ||
110 | if (tdesc) | |
111 | *************** | |
112 | *** 6990,6994 **** | |
113 | list = list_rest_of_args (); | |
114 | ||
115 | ! if (list == 0 && unbound_vars_is_error) | |
116 | { | |
117 | uerror[0] = '$'; | |
118 | --- 6991,6995 ---- | |
119 | list = list_rest_of_args (); | |
120 | ||
121 | ! if (list == 0 && unbound_vars_is_error && (pflags & PF_IGNUNBOUND) == 0) | |
122 | { | |
123 | uerror[0] = '$'; | |
124 | *************** | |
125 | *** 7052,7056 **** | |
126 | list = list_rest_of_args (); | |
127 | ||
128 | ! if (list == 0 && unbound_vars_is_error) | |
129 | { | |
130 | uerror[0] = '$'; | |
131 | --- 7053,7057 ---- | |
132 | list = list_rest_of_args (); | |
133 | ||
134 | ! if (list == 0 && unbound_vars_is_error && (pflags & PF_IGNUNBOUND) == 0) | |
135 | { | |
136 | uerror[0] = '$'; | |
137 | ||
138 | ||
139 | *** ../bash-4.0/patchlevel.h 2009-01-04 14:32:40.000000000 -0500 | |
140 | --- patchlevel.h 2009-02-22 16:11:31.000000000 -0500 | |
141 | *************** | |
142 | *** 26,30 **** | |
143 | looks for to find the patch level (for the sccs version string). */ | |
144 | ||
145 | ! #define PATCHLEVEL 12 | |
146 | ||
147 | #endif /* _PATCHLEVEL_H_ */ | |
148 | --- 26,30 ---- | |
149 | looks for to find the patch level (for the sccs version string). */ | |
150 | ||
151 | ! #define PATCHLEVEL 13 | |
152 | ||
153 | #endif /* _PATCHLEVEL_H_ */ |