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) | |
download | busybox-w32-e84212f8346741a2d4a04b40639c44fe519cf5a7.tar.gz busybox-w32-e84212f8346741a2d4a04b40639c44fe519cf5a7.tar.bz2 busybox-w32-e84212f8346741a2d4a04b40639c44fe519cf5a7.zip |
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) | |||
3851 | if (ctx->pending_redirect) { | 3851 | if (ctx->pending_redirect) { |
3852 | /* We do not glob in e.g. >*.tmp case. bash seems to glob here | 3852 | /* We do not glob in e.g. >*.tmp case. bash seems to glob here |
3853 | * only if run as "bash", not "sh" */ | 3853 | * only if run as "bash", not "sh" */ |
3854 | /* http://www.opengroup.org/onlinepubs/009695399/utilities/xcu_chap02.html | 3854 | /* http://pubs.opengroup.org/onlinepubs/9699919799/utilities/V3_chap02.html |
3855 | * "2.7 Redirection | 3855 | * "2.7 Redirection |
3856 | * ...the word that follows the redirection operator | 3856 | * If the redirection operator is "<<" or "<<-", the word |
3857 | * shall be subjected to tilde expansion, parameter expansion, | 3857 | * that follows the redirection operator shall be |
3858 | * command substitution, arithmetic expansion, and quote | 3858 | * subjected to quote removal; it is unspecified whether |
3859 | * removal. Pathname expansion shall not be performed | 3859 | * any of the other expansions occur. For the other |
3860 | * redirection operators, the word that follows the | ||
3861 | * redirection operator shall be subjected to tilde | ||
3862 | * expansion, parameter expansion, command substitution, | ||
3863 | * arithmetic expansion, and quote removal. | ||
3864 | * Pathname expansion shall not be performed | ||
3860 | * on the word by a non-interactive shell; an interactive | 3865 | * on the word by a non-interactive shell; an interactive |
3861 | * shell may perform it, but shall do so only when | 3866 | * shell may perform it, but shall do so only when |
3862 | * the expansion would result in one word." | 3867 | * the expansion would result in one word." |
@@ -3866,8 +3871,8 @@ static int done_word(o_string *word, struct parse_context *ctx) | |||
3866 | // as written: | 3871 | // as written: |
3867 | // <<EOF$t | 3872 | // <<EOF$t |
3868 | // <<EOF$((1)) | 3873 | // <<EOF$((1)) |
3869 | // <<EOF`true` [this case also makes heredoc "quoted", a-la <<"EOF"] | 3874 | // <<EOF`true` [this case also makes heredoc "quoted", a-la <<"EOF". Probably bash-4.3.43 bug] |
3870 | //This contradicts the above docs. | 3875 | |
3871 | ctx->pending_redirect->rd_filename = xstrdup(word->data); | 3876 | ctx->pending_redirect->rd_filename = xstrdup(word->data); |
3872 | /* Cater for >\file case: | 3877 | /* Cater for >\file case: |
3873 | * >\a creates file a; >\\a, >"\a", >"\\a" create file \a | 3878 | * >\a creates file a; >\\a, >"\a", >"\\a" create file \a |