From f1495f5099073e2e4896c13e28e8d936b4979fd3 Mon Sep 17 00:00:00 2001 From: Peter Stephenson Date: Tue, 14 Sep 2010 14:46:26 +0000 Subject: 28259: Finally fix some ancient problems with here-documents --- Src/lex.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'Src/lex.c') 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; } -- cgit 1.4.1