|
|
ff19ae |
BASH PATCH REPORT
|
|
|
ff19ae |
=================
|
|
|
ff19ae |
|
|
|
ff19ae |
Bash-Release: 4.2
|
|
|
ff19ae |
Patch-ID: bash42-036
|
|
|
ff19ae |
|
|
|
ff19ae |
Bug-Reported-by: gregrwm <backuppc-users@whitleymott.net>
|
|
|
ff19ae |
Bug-Reference-ID: <CAD+dB9B4JG+qUwZBQUwiQmVt0j6NDn=DDTxr9R+nkA8DL4KLJA@mail.gmail.com>
|
|
|
ff19ae |
Bug-Reference-URL: http://lists.gnu.org/archive/html/bug-bash/2012-05/msg00108.html
|
|
|
ff19ae |
|
|
|
ff19ae |
Bug-Description:
|
|
|
ff19ae |
|
|
|
ff19ae |
Bash-4.2 produces incorrect word splitting results when expanding
|
|
|
ff19ae |
double-quoted $@ in the same string as and adjacent to other variable
|
|
|
ff19ae |
expansions. The $@ should be split, the other expansions should not.
|
|
|
ff19ae |
|
|
|
ff19ae |
Patch (apply with `patch -p0'):
|
|
|
ff19ae |
|
|
|
ff19ae |
*** ../bash-4.2-patched/subst.c 2012-05-02 12:02:33.000000000 -0400
|
|
|
ff19ae |
--- subst.c 2012-07-08 21:19:32.000000000 -0400
|
|
|
ff19ae |
***************
|
|
|
ff19ae |
*** 7923,7927 ****
|
|
|
ff19ae |
/* State flags */
|
|
|
ff19ae |
int had_quoted_null;
|
|
|
ff19ae |
! int has_dollar_at;
|
|
|
ff19ae |
int tflag;
|
|
|
ff19ae |
int pflags; /* flags passed to param_expand */
|
|
|
ff19ae |
--- 7923,7927 ----
|
|
|
ff19ae |
/* State flags */
|
|
|
ff19ae |
int had_quoted_null;
|
|
|
ff19ae |
! int has_dollar_at, temp_has_dollar_at;
|
|
|
ff19ae |
int tflag;
|
|
|
ff19ae |
int pflags; /* flags passed to param_expand */
|
|
|
ff19ae |
***************
|
|
|
ff19ae |
*** 8128,8138 ****
|
|
|
ff19ae |
*expanded_something = 1;
|
|
|
ff19ae |
|
|
|
ff19ae |
! has_dollar_at = 0;
|
|
|
ff19ae |
pflags = (word->flags & W_NOCOMSUB) ? PF_NOCOMSUB : 0;
|
|
|
ff19ae |
if (word->flags & W_NOSPLIT2)
|
|
|
ff19ae |
pflags |= PF_NOSPLIT2;
|
|
|
ff19ae |
tword = param_expand (string, &sindex, quoted, expanded_something,
|
|
|
ff19ae |
! &has_dollar_at, "ed_dollar_at,
|
|
|
ff19ae |
&had_quoted_null, pflags);
|
|
|
ff19ae |
|
|
|
ff19ae |
if (tword == &expand_wdesc_error || tword == &expand_wdesc_fatal)
|
|
|
ff19ae |
--- 8128,8139 ----
|
|
|
ff19ae |
*expanded_something = 1;
|
|
|
ff19ae |
|
|
|
ff19ae |
! temp_has_dollar_at = 0;
|
|
|
ff19ae |
pflags = (word->flags & W_NOCOMSUB) ? PF_NOCOMSUB : 0;
|
|
|
ff19ae |
if (word->flags & W_NOSPLIT2)
|
|
|
ff19ae |
pflags |= PF_NOSPLIT2;
|
|
|
ff19ae |
tword = param_expand (string, &sindex, quoted, expanded_something,
|
|
|
ff19ae |
! &temp_has_dollar_at, "ed_dollar_at,
|
|
|
ff19ae |
&had_quoted_null, pflags);
|
|
|
ff19ae |
+ has_dollar_at += temp_has_dollar_at;
|
|
|
ff19ae |
|
|
|
ff19ae |
if (tword == &expand_wdesc_error || tword == &expand_wdesc_fatal)
|
|
|
ff19ae |
***************
|
|
|
ff19ae |
*** 8275,8281 ****
|
|
|
ff19ae |
temp = (char *)NULL;
|
|
|
ff19ae |
|
|
|
ff19ae |
! has_dollar_at = 0;
|
|
|
ff19ae |
/* Need to get W_HASQUOTEDNULL flag through this function. */
|
|
|
ff19ae |
! list = expand_word_internal (tword, Q_DOUBLE_QUOTES, 0, &has_dollar_at, (int *)NULL);
|
|
|
ff19ae |
|
|
|
ff19ae |
if (list == &expand_word_error || list == &expand_word_fatal)
|
|
|
ff19ae |
--- 8276,8283 ----
|
|
|
ff19ae |
temp = (char *)NULL;
|
|
|
ff19ae |
|
|
|
ff19ae |
! temp_has_dollar_at = 0; /* XXX */
|
|
|
ff19ae |
/* Need to get W_HASQUOTEDNULL flag through this function. */
|
|
|
ff19ae |
! list = expand_word_internal (tword, Q_DOUBLE_QUOTES, 0, &temp_has_dollar_at, (int *)NULL);
|
|
|
ff19ae |
! has_dollar_at += temp_has_dollar_at;
|
|
|
ff19ae |
|
|
|
ff19ae |
if (list == &expand_word_error || list == &expand_word_fatal)
|
|
|
ff19ae |
*** ../bash-4.2-patched/patchlevel.h Sat Jun 12 20:14:48 2010
|
|
|
ff19ae |
--- patchlevel.h Thu Feb 24 21:41:34 2011
|
|
|
ff19ae |
***************
|
|
|
ff19ae |
*** 26,30 ****
|
|
|
ff19ae |
looks for to find the patch level (for the sccs version string). */
|
|
|
ff19ae |
|
|
|
ff19ae |
! #define PATCHLEVEL 35
|
|
|
ff19ae |
|
|
|
ff19ae |
#endif /* _PATCHLEVEL_H_ */
|
|
|
ff19ae |
--- 26,30 ----
|
|
|
ff19ae |
looks for to find the patch level (for the sccs version string). */
|
|
|
ff19ae |
|
|
|
ff19ae |
! #define PATCHLEVEL 36
|
|
|
ff19ae |
|
|
|
ff19ae |
#endif /* _PATCHLEVEL_H_ */
|