diff options
author | Denys Vlasenko <vda.linux@googlemail.com> | 2018-04-01 20:11:23 +0200 |
---|---|---|
committer | Denys Vlasenko <vda.linux@googlemail.com> | 2018-04-01 20:11:23 +0200 |
commit | e84212f8346741a2d4a04b40639c44fe519cf5a7 (patch) | |
tree | 2d299f26a0fad19f4b42e0d57b357dc78ddde69b | |
parent | 899ae5337acc2d24edcd64e570adfc5f3c1a8a8a (diff) |
hush: update information comment about heredoc discrepancy
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
-rw-r--r-- | shell/hush.c | 19 |
1 files changed, 12 insertions, 7 deletions
diff --git a/shell/hush.c b/shell/hush.c index 8246b5fd8..06fe0e405 100644 --- a/shell/hush.c +++ b/shell/hush.c @@ -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 |