hush: update information comment about heredoc discrepancy
authorDenys Vlasenko <vda.linux@googlemail.com>
Sun, 1 Apr 2018 18:11:23 +0000 (20:11 +0200)
committerDenys Vlasenko <vda.linux@googlemail.com>
Sun, 1 Apr 2018 18:11:23 +0000 (20:11 +0200)
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
shell/hush.c

index 8246b5fd87db2f7f49fda9221cb5a07c8df4bf0e..06fe0e405dedd71b0ad2b1869545799e30c843f3 100644 (file)
@@ -3851,12 +3851,17 @@ static int done_word(o_string *word, struct parse_context *ctx)
        if (ctx->pending_redirect) {
                /* We do not glob in e.g. >*.tmp case. bash seems to glob here
                 * only if run as "bash", not "sh" */
-               /* http://www.opengroup.org/onlinepubs/009695399/utilities/xcu_chap02.html
+               /* http://pubs.opengroup.org/onlinepubs/9699919799/utilities/V3_chap02.html
                 * "2.7 Redirection
-                * ...the word that follows the redirection operator
-                * shall be subjected to tilde expansion, parameter expansion,
-                * command substitution, arithmetic expansion, and quote
-                * removal. Pathname expansion shall not be performed
+                * If the redirection operator is "<<" or "<<-", the word
+                * that follows the redirection operator shall be
+                * subjected to quote removal; it is unspecified whether
+                * any of the other expansions occur. For the other
+                * redirection operators, the word that follows the
+                * redirection operator shall be subjected to tilde
+                * expansion, parameter expansion, command substitution,
+                * arithmetic expansion, and quote removal.
+                * Pathname expansion shall not be performed
                 * on the word by a non-interactive shell; an interactive
                 * shell may perform it, but shall do so only when
                 * the expansion would result in one word."
@@ -3866,8 +3871,8 @@ static int done_word(o_string *word, struct parse_context *ctx)
 // as written:
 // <<EOF$t
 // <<EOF$((1))
-// <<EOF`true`  [this case also makes heredoc "quoted", a-la <<"EOF"]
-//This contradicts the above docs.
+// <<EOF`true`  [this case also makes heredoc "quoted", a-la <<"EOF". Probably bash-4.3.43 bug]
+
                ctx->pending_redirect->rd_filename = xstrdup(word->data);
                /* Cater for >\file case:
                 * >\a creates file a; >\\a, >"\a", >"\\a" create file \a