about summary refs log tree commit diff
path: root/Src/parse.c
diff options
context:
space:
mode:
authorBart Schaefer <barts@users.sourceforge.net>2004-10-02 21:44:13 +0000
committerBart Schaefer <barts@users.sourceforge.net>2004-10-02 21:44:13 +0000
commit684da738b06f27d2736d6f60429f26206dc2ffbc (patch)
tree76d95bb39fc2e78815b2fd43720d77cd32183429 /Src/parse.c
parentf986922ac262e10135132cb0b258cc834b3e6877 (diff)
downloadzsh-684da738b06f27d2736d6f60429f26206dc2ffbc.tar.gz
zsh-684da738b06f27d2736d6f60429f26206dc2ffbc.tar.xz
zsh-684da738b06f27d2736d6f60429f26206dc2ffbc.zip
20418: report parse error rather than crash on unfinished pipelines.
Diffstat (limited to 'Src/parse.c')
-rw-r--r--Src/parse.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/Src/parse.c b/Src/parse.c
index 551573f5a..d0f108333 100644
--- a/Src/parse.c
+++ b/Src/parse.c
@@ -729,7 +729,9 @@ par_pline(int *complex)
 	ecbuf[p] = WCB_PIPE(WC_PIPE_MID, (line >= 0 ? line + 1 : 0));
 	ecispace(p + 1, 1);
 	ecbuf[p + 1] = ecused - 1 - p;
-	par_pline(complex);
+	if (!par_pline(complex)) {
+	    tok = LEXERR;
+	}
 	cmdpop();
 	return 1;
     } else if (tok == BARAMP) {
@@ -750,7 +752,9 @@ par_pline(int *complex)
 	ecbuf[p] = WCB_PIPE(WC_PIPE_MID, (line >= 0 ? line + 1 : 0));
 	ecispace(p + 1, 1);
 	ecbuf[p + 1] = ecused - 1 - p;
-	par_pline(complex);
+	if (!par_pline(complex)) {
+	    tok = LEXERR;
+	}
 	cmdpop();
 	return 1;
     } else {