]>
Commit | Line | Data |
---|---|---|
387ec419 AM |
1 | BASH PATCH REPORT |
2 | ================= | |
3 | ||
4 | Bash-Release: 4.0 | |
5 | Patch-ID: bash40-028 | |
6 | ||
7 | Bug-Reported-by: martin f krafft <madduck@debian.org> | |
8 | Bug-Reference-ID: <4A4E39E7.5080807@debian.org> | |
9 | Bug-Reference-URL: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=519165 | |
10 | http://lists.gnu.org/archive/html/bug-bash/2009-07/msg00011.html | |
11 | ||
12 | Bug-Description: | |
13 | ||
14 | bash-4.0 reverted to the historical shell behavior of raising an error | |
15 | when $@ or $* was expanded after `set -u' had been executed and there | |
16 | were no positional parameters. The Posix working group has since | |
17 | clarified the standard's position on the issue, and $@ and $* are now the | |
18 | only variables, parameters, or special parameters that do not raise an | |
19 | error when unset if set -u is enabled. | |
20 | ||
21 | Patch: | |
22 | ||
23 | *** ../bash-4.0-patched/subst.c Mon Mar 23 11:34:55 2009 | |
24 | --- subst.c Wed Jun 17 18:12:18 2009 | |
25 | *************** | |
26 | *** 6768,6778 **** | |
27 | ||
28 | case RBRACE: | |
29 | ! if (var_is_set == 0 && unbound_vars_is_error) | |
30 | { | |
31 | err_unboundvar (name); | |
32 | FREE (value); | |
33 | FREE (temp); | |
34 | free (name); | |
35 | - last_command_exit_value = EXECUTION_FAILURE; | |
36 | return (interactive_shell ? &expand_wdesc_error : &expand_wdesc_fatal); | |
37 | } | |
38 | --- 6794,6804 ---- | |
39 | ||
40 | case RBRACE: | |
41 | ! if (var_is_set == 0 && unbound_vars_is_error && ((name[0] != '@' && name[0] != '*') || name[1])) | |
42 | { | |
43 | + last_command_exit_value = EXECUTION_FAILURE; | |
44 | err_unboundvar (name); | |
45 | FREE (value); | |
46 | FREE (temp); | |
47 | free (name); | |
48 | return (interactive_shell ? &expand_wdesc_error : &expand_wdesc_fatal); | |
49 | } | |
50 | *************** | |
51 | *** 6991,6994 **** | |
52 | --- 7017,7029 ---- | |
53 | list = list_rest_of_args (); | |
54 | ||
55 | + #if 0 | |
56 | + /* According to austin-group posix proposal by Geoff Clare in | |
57 | + <20090505091501.GA10097@squonk.masqnet> of 5 May 2009: | |
58 | + | |
59 | + "The shell shall write a message to standard error and | |
60 | + immediately exit when it tries to expand an unset parameter | |
61 | + other than the '@' and '*' special parameters." | |
62 | + */ | |
63 | + | |
64 | if (list == 0 && unbound_vars_is_error && (pflags & PF_IGNUNBOUND) == 0) | |
65 | { | |
66 | *************** | |
67 | *** 6996,7003 **** | |
68 | uerror[1] = '*'; | |
69 | uerror[2] = '\0'; | |
70 | - err_unboundvar (uerror); | |
71 | last_command_exit_value = EXECUTION_FAILURE; | |
72 | return (interactive_shell ? &expand_wdesc_error : &expand_wdesc_fatal); | |
73 | } | |
74 | ||
75 | /* If there are no command-line arguments, this should just | |
76 | --- 7031,7039 ---- | |
77 | uerror[1] = '*'; | |
78 | uerror[2] = '\0'; | |
79 | last_command_exit_value = EXECUTION_FAILURE; | |
80 | + err_unboundvar (uerror); | |
81 | return (interactive_shell ? &expand_wdesc_error : &expand_wdesc_fatal); | |
82 | } | |
83 | + #endif | |
84 | ||
85 | /* If there are no command-line arguments, this should just | |
86 | *************** | |
87 | *** 7053,7056 **** | |
88 | --- 7089,7101 ---- | |
89 | list = list_rest_of_args (); | |
90 | ||
91 | + #if 0 | |
92 | + /* According to austin-group posix proposal by Geoff Clare in | |
93 | + <20090505091501.GA10097@squonk.masqnet> of 5 May 2009: | |
94 | + | |
95 | + "The shell shall write a message to standard error and | |
96 | + immediately exit when it tries to expand an unset parameter | |
97 | + other than the '@' and '*' special parameters." | |
98 | + */ | |
99 | + | |
100 | if (list == 0 && unbound_vars_is_error && (pflags & PF_IGNUNBOUND) == 0) | |
101 | { | |
102 | *************** | |
103 | *** 7058,7065 **** | |
104 | uerror[1] = '@'; | |
105 | uerror[2] = '\0'; | |
106 | - err_unboundvar (uerror); | |
107 | last_command_exit_value = EXECUTION_FAILURE; | |
108 | return (interactive_shell ? &expand_wdesc_error : &expand_wdesc_fatal); | |
109 | } | |
110 | ||
111 | /* We want to flag the fact that we saw this. We can't turn | |
112 | --- 7103,7111 ---- | |
113 | uerror[1] = '@'; | |
114 | uerror[2] = '\0'; | |
115 | last_command_exit_value = EXECUTION_FAILURE; | |
116 | + err_unboundvar (uerror); | |
117 | return (interactive_shell ? &expand_wdesc_error : &expand_wdesc_fatal); | |
118 | } | |
119 | + #endif | |
120 | ||
121 | /* We want to flag the fact that we saw this. We can't turn | |
122 | *** ../bash-4.0-patched/doc/bash.1 Wed Feb 18 15:13:56 2009 | |
123 | --- doc/bash.1 Wed Jun 17 08:51:19 2009 | |
124 | *************** | |
125 | *** 8258,8264 **** | |
126 | .TP 8 | |
127 | .B \-u | |
128 | ! Treat unset variables as an error when performing | |
129 | parameter expansion. If expansion is attempted on an | |
130 | ! unset variable, the shell prints an error message, and, | |
131 | if not interactive, exits with a non-zero status. | |
132 | .TP 8 | |
133 | --- 8274,8281 ---- | |
134 | .TP 8 | |
135 | .B \-u | |
136 | ! Treat unset variables and parameters other than the special | |
137 | ! parameters "@" and "*" as an error when performing | |
138 | parameter expansion. If expansion is attempted on an | |
139 | ! unset variable or parameter, the shell prints an error message, and, | |
140 | if not interactive, exits with a non-zero status. | |
141 | .TP 8 | |
142 | *** ../bash-4.0-patched/doc/bashref.texi Wed Feb 18 15:14:43 2009 | |
143 | --- doc/bashref.texi Wed Jun 17 08:50:46 2009 | |
144 | *************** | |
145 | *** 4139,4143 **** | |
146 | ||
147 | @item -u | |
148 | ! Treat unset variables as an error when performing parameter expansion. | |
149 | An error message will be written to the standard error, and a non-interactive | |
150 | shell will exit. | |
151 | --- 4151,4156 ---- | |
152 | ||
153 | @item -u | |
154 | ! Treat unset variables and parameters other than the special parameters | |
155 | ! @samp{@@} or @samp{*} as an error when performing parameter expansion. | |
156 | An error message will be written to the standard error, and a non-interactive | |
157 | shell will exit. | |
158 | *** ../bash-4.0/patchlevel.h 2009-01-04 14:32:40.000000000 -0500 | |
159 | --- patchlevel.h 2009-02-22 16:11:31.000000000 -0500 | |
160 | *************** | |
161 | *** 26,30 **** | |
162 | looks for to find the patch level (for the sccs version string). */ | |
163 | ||
164 | ! #define PATCHLEVEL 27 | |
165 | ||
166 | #endif /* _PATCHLEVEL_H_ */ | |
167 | --- 26,30 ---- | |
168 | looks for to find the patch level (for the sccs version string). */ | |
169 | ||
170 | ! #define PATCHLEVEL 28 | |
171 | ||
172 | #endif /* _PATCHLEVEL_H_ */ |