aboutsummaryrefslogtreecommitdiffstats
path: root/subst.c
diff options
context:
space:
mode:
authorChet Ramey <chet.ramey@case.edu>2012-05-07 16:23:39 -0400
committerChet Ramey <chet.ramey@case.edu>2012-05-07 16:23:39 -0400
commitcd110fdfc29a8766f71a8f9fbb0e011b83d23763 (patch)
treefae7164be4127d26c8e2da8071678244bd05c74b /subst.c
parent91717ba3b24d1ed49c47b35b88cf3d44c2eb0dc3 (diff)
downloadandroid_external_bash-cd110fdfc29a8766f71a8f9fbb0e011b83d23763.tar.gz
android_external_bash-cd110fdfc29a8766f71a8f9fbb0e011b83d23763.tar.bz2
android_external_bash-cd110fdfc29a8766f71a8f9fbb0e011b83d23763.zip
Bash-4.2 patch 28
Diffstat (limited to 'subst.c')
-rw-r--r--subst.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/subst.c b/subst.c
index b6476d8..fa4e5dc 100644
--- a/subst.c
+++ b/subst.c
@@ -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)