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
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.
23 *** ../bash-4.0-patched/subst.c Mon Mar 23 11:34:55 2009
24 --- subst.c Wed Jun 17 18:12:18 2009
29 ! if (var_is_set == 0 && unbound_vars_is_error)
31 err_unboundvar (name);
35 - last_command_exit_value = EXECUTION_FAILURE;
36 return (interactive_shell ? &expand_wdesc_error : &expand_wdesc_fatal);
41 ! if (var_is_set == 0 && unbound_vars_is_error && ((name[0] != '@' && name[0] != '*') || name[1]))
43 + last_command_exit_value = EXECUTION_FAILURE;
44 err_unboundvar (name);
48 return (interactive_shell ? &expand_wdesc_error : &expand_wdesc_fatal);
53 list = list_rest_of_args ();
56 + /* According to austin-group posix proposal by Geoff Clare in
57 + <20090505091501.GA10097@squonk.masqnet> of 5 May 2009:
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."
64 if (list == 0 && unbound_vars_is_error && (pflags & PF_IGNUNBOUND) == 0)
70 - err_unboundvar (uerror);
71 last_command_exit_value = EXECUTION_FAILURE;
72 return (interactive_shell ? &expand_wdesc_error : &expand_wdesc_fatal);
75 /* If there are no command-line arguments, this should just
79 last_command_exit_value = EXECUTION_FAILURE;
80 + err_unboundvar (uerror);
81 return (interactive_shell ? &expand_wdesc_error : &expand_wdesc_fatal);
85 /* If there are no command-line arguments, this should just
89 list = list_rest_of_args ();
92 + /* According to austin-group posix proposal by Geoff Clare in
93 + <20090505091501.GA10097@squonk.masqnet> of 5 May 2009:
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."
100 if (list == 0 && unbound_vars_is_error && (pflags & PF_IGNUNBOUND) == 0)
106 - err_unboundvar (uerror);
107 last_command_exit_value = EXECUTION_FAILURE;
108 return (interactive_shell ? &expand_wdesc_error : &expand_wdesc_fatal);
111 /* We want to flag the fact that we saw this. We can't turn
115 last_command_exit_value = EXECUTION_FAILURE;
116 + err_unboundvar (uerror);
117 return (interactive_shell ? &expand_wdesc_error : &expand_wdesc_fatal);
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
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.
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.
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
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
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
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
162 looks for to find the patch level (for the sccs version string). */
164 ! #define PATCHLEVEL 27
166 #endif /* _PATCHLEVEL_H_ */
168 looks for to find the patch level (for the sccs version string). */
170 ! #define PATCHLEVEL 28
172 #endif /* _PATCHLEVEL_H_ */