summaryrefslogtreecommitdiff
path: root/Src/parse.c
diff options
context:
space:
mode:
Diffstat (limited to 'Src/parse.c')
-rw-r--r--Src/parse.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/Src/parse.c b/Src/parse.c
index af3cba9d3..54543a642 100644
--- a/Src/parse.c
+++ b/Src/parse.c
@@ -1861,7 +1861,7 @@ par_redir(int *rp, char *idstring)
void
setheredoc(int pc, int type, char *str)
{
- ecbuf[pc] = WCB_REDIR(type);
+ ecbuf[pc] = WCB_REDIR(type | REDIR_FROM_HEREDOC_MASK);
ecbuf[pc + 2] = ecstrcode(str);
}
@@ -2409,6 +2409,10 @@ ecgetredirs(Estate s)
r->type = WC_REDIR_TYPE(code);
r->fd1 = *s->pc++;
r->name = ecgetstr(s, EC_DUP, NULL);
+ if (WC_REDIR_FROM_HEREDOC(code))
+ r->flags = REDIRF_FROM_HEREDOC;
+ else
+ r->flags = 0;
if (WC_REDIR_VARID(code))
r->varid = ecgetstr(s, EC_DUP, NULL);
else