Bash-4.2 patch 28

This commit is contained in:
Chet Ramey 2012-05-07 16:23:39 -04:00
commit cd110fdfc2
2 changed files with 11 additions and 1 deletions

10
subst.c
View file

@ -5809,6 +5809,16 @@ parameter_brace_expand_rhs (name, value, c, quoted, qdollaratp, hasdollarat)
is the only expansion that creates more than one word. */
if (qdollaratp && ((hasdol && quoted) || l->next))
*qdollaratp = 1;
/* If we have a quoted null result (QUOTED_NULL(temp)) and the word is
a quoted null (l->next == 0 && QUOTED_NULL(l->word->word)), the
flags indicate it (l->word->flags & W_HASQUOTEDNULL), and the
expansion is quoted (quoted & (Q_HERE_DOCUMENT|Q_DOUBLE_QUOTES))
(which is more paranoia than anything else), we need to return the
quoted null string and set the flags to indicate it. */
if (l->next == 0 && (quoted & (Q_HERE_DOCUMENT|Q_DOUBLE_QUOTES)) && QUOTED_NULL(temp) && QUOTED_NULL(l->word->word) && (l->word->flags & W_HASQUOTEDNULL))
{
w->flags |= W_HASQUOTEDNULL;
}
dispose_words (l);
}
else if ((quoted & (Q_HERE_DOCUMENT|Q_DOUBLE_QUOTES)) && hasdol)