about summary refs log tree commit diff
path: root/Src
diff options
context:
space:
mode:
authorSven Wischnowsky <wischnow@users.sourceforge.net>2001-09-25 12:10:05 +0000
committerSven Wischnowsky <wischnow@users.sourceforge.net>2001-09-25 12:10:05 +0000
commitc2266c1f5fccb97bf650b02dbc683e82c167aba7 (patch)
tree8a0ba1a0ff2f49db7017a1dab3502d313a36e959 /Src
parent66b3e3412ddfc8ee0bb37bef8837ac924cc664f5 (diff)
downloadzsh-c2266c1f5fccb97bf650b02dbc683e82c167aba7.tar.gz
zsh-c2266c1f5fccb97bf650b02dbc683e82c167aba7.tar.xz
zsh-c2266c1f5fccb97bf650b02dbc683e82c167aba7.zip
job text building code couldn't handle empty sublists (as in `coproc || test') (15868)
Diffstat (limited to 'Src')
-rw-r--r--Src/text.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/Src/text.c b/Src/text.c
index 2215b45fd..73b409e02 100644
--- a/Src/text.c
+++ b/Src/text.c
@@ -274,10 +274,12 @@ gettext2(Estate state)
 	    break;
 	case WC_SUBLIST:
 	    if (!s) {
+                if (wc_code(*state->pc) != WC_PIPE)
+                    stack = 1;
 		if (WC_SUBLIST_FLAGS(code) & WC_SUBLIST_NOT)
-		    taddstr("! ");
+		    taddstr(stack ? "!" : "! ");
 		if (WC_SUBLIST_FLAGS(code) & WC_SUBLIST_COPROC)
-		    taddstr("coproc ");
+		    taddstr(stack ? "coproc" : "coproc ");
 		s = tpush(code, (WC_SUBLIST_TYPE(code) == WC_SUBLIST_END));
 	    } else {
 		if (!(stack = (WC_SUBLIST_TYPE(code) == WC_SUBLIST_END))) {