From: Denys Vlasenko Date: Sun, 1 Apr 2018 16:55:00 +0000 (+0200) Subject: hush: add a comment where we differ from bash wrt heredoc EOF mark handling X-Git-Tag: 1_29_0~163 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=bb6f573ad204887e2447a40628efd98f334fb520;p=oweals%2Fbusybox.git hush: add a comment where we differ from bash wrt heredoc EOF mark handling Signed-off-by: Denys Vlasenko --- diff --git a/shell/hush.c b/shell/hush.c index 4b8641d19..1921932d1 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: +// <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) { diff --git a/shell/hush_test/hush-heredoc/heredoc_backquote1.right b/shell/hush_test/hush-heredoc/heredoc_backquote1.right deleted file mode 100644 index 0be2a3296..000000000 --- a/shell/hush_test/hush-heredoc/heredoc_backquote1.right +++ /dev/null @@ -1,5 +0,0 @@ -heredoc1 -Ok1:0 -heredoc2 -EO`false`F -Ok2:0 diff --git a/shell/hush_test/hush-heredoc/heredoc_backquote1.tests b/shell/hush_test/hush-heredoc/heredoc_backquote1.tests deleted file mode 100755 index ec3d8fe1d..000000000 --- a/shell/hush_test/hush-heredoc/heredoc_backquote1.tests +++ /dev/null @@ -1,10 +0,0 @@ -cat <