diff options
author | Peter Stephenson <pws@users.sourceforge.net> | 2010-09-14 14:46:26 +0000 |
---|---|---|
committer | Peter Stephenson <pws@users.sourceforge.net> | 2010-09-14 14:46:26 +0000 |
commit | f1495f5099073e2e4896c13e28e8d936b4979fd3 (patch) | |
tree | d793cce372b9e1c4435db4174867c8a4cb37cb0c /Src/lex.c | |
parent | 3b6b4982b9a61cb84888e8eba7200637fc3b3c12 (diff) | |
download | zsh-f1495f5099073e2e4896c13e28e8d936b4979fd3.tar.gz zsh-f1495f5099073e2e4896c13e28e8d936b4979fd3.tar.xz zsh-f1495f5099073e2e4896c13e28e8d936b4979fd3.zip |
28259: Finally fix some ancient problems with here-documents
Diffstat (limited to 'Src/lex.c')
-rw-r--r-- | Src/lex.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/Src/lex.c b/Src/lex.c index 83257da8c..28899fef0 100644 --- a/Src/lex.c +++ b/Src/lex.c @@ -384,16 +384,17 @@ zshlex(void) if (tok == NEWLIN || tok == ENDINPUT) { while (hdocs) { struct heredocs *next = hdocs->next; - char *name; + char *doc, *munged_term; hwbegin(0); cmdpush(hdocs->type == REDIR_HEREDOC ? CS_HEREDOC : CS_HEREDOCD); + munged_term = dupstring(hdocs->str); STOPHIST - name = gethere(hdocs->str, hdocs->type); + doc = gethere(&munged_term, hdocs->type); ALLOWHIST cmdpop(); hwend(); - if (!name) { + if (!doc) { zerr("here document too large"); while (hdocs) { next = hdocs->next; @@ -403,7 +404,8 @@ zshlex(void) tok = LEXERR; break; } - setheredoc(hdocs->pc, REDIR_HERESTR, name); + setheredoc(hdocs->pc, REDIR_HERESTR, doc, hdocs->str, + munged_term); zfree(hdocs, sizeof(struct heredocs)); hdocs = next; } |