summaryrefslogtreecommitdiff
path: root/shell/hush.c
diff options
context:
space:
mode:
authorDenys Vlasenko2018-04-01 18:55:00 +0200
committerDenys Vlasenko2018-04-01 18:55:00 +0200
commitbb6f573ad204887e2447a40628efd98f334fb520 (patch)
treeb088b3516d3e5662563657a0818016741f643034 /shell/hush.c
parent41fddb43729373740bfba82da83373ec5ba49fc8 (diff)
downloadbusybox-bb6f573ad204887e2447a40628efd98f334fb520.zip
busybox-bb6f573ad204887e2447a40628efd98f334fb520.tar.gz
hush: add a comment where we differ from bash wrt heredoc EOF mark handling
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
Diffstat (limited to 'shell/hush.c')
-rw-r--r--shell/hush.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/shell/hush.c b/shell/hush.c
index 4b8641d..1921932 100644
--- a/shell/hush.c
+++ b/shell/hush.c
@@ -3861,6 +3861,13 @@ static int done_word(o_string *word, struct parse_context *ctx)
* shell may perform it, but shall do so only when
* the expansion would result in one word."
*/
+//bash does not do parameter/command substitution or arithmetic expansion
+//for _heredoc_ redirection word: these constructs look for exact eof marker
+// as written:
+// <<EOF$t
+// <<EOF$((1))
+// <<EOF`true` [this case also makes heredoc "quoted", a-la <<"EOF"]
+//This contradicts the above docs.
ctx->pending_redirect->rd_filename = xstrdup(word->data);
/* Cater for >\file case:
* >\a creates file a; >\\a, >"\a", >"\\a" create file \a
@@ -4228,6 +4235,7 @@ static int fetch_heredocs(int heredoc_cnt, struct parse_context *ctx, struct in_
redir->rd_type = REDIRECT_HEREDOC2;
/* redir->rd_dup is (ab)used to indicate <<- */
+bb_error_msg("redir->rd_filename:'%s'", redir->rd_filename);
p = fetch_till_str(&ctx->as_string, input,
redir->rd_filename, redir->rd_dup);
if (!p) {