From e84212f8346741a2d4a04b40639c44fe519cf5a7 Mon Sep 17 00:00:00 2001 From: Denys Vlasenko Date: Sun, 1 Apr 2018 20:11:23 +0200 Subject: [PATCH] hush: update information comment about heredoc discrepancy Signed-off-by: Denys Vlasenko --- shell/hush.c | 19 ++++++++++++------- 1 file 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: // <pending_redirect->rd_filename = xstrdup(word->data); /* Cater for >\file case: * >\a creates file a; >\\a, >"\a", >"\\a" create file \a -- 2.25.1