From a1e0eed861cf18b043107f50823a9a498347d89f Mon Sep 17 00:00:00 2001 From: Tanaka Akira Date: Tue, 8 Feb 2000 11:02:23 +0000 Subject: zsh-workers/9617 --- Src/exec.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'Src/exec.c') diff --git a/Src/exec.c b/Src/exec.c index fb73e124e..7b45a1ba2 100644 --- a/Src/exec.c +++ b/Src/exec.c @@ -1661,11 +1661,16 @@ execcmd(Estate state, int input, int output, int how, int last1) } else if (varspc) { nullexec = 2; break; - } else if (!nullcmd || !*nullcmd || - (cflags & BINF_PREFIX)) { + } else if (((!nullcmd || !*nullcmd || opts[IGNORENULLCMD]) + && !opts[SHNULLCMD]) + ||(cflags & BINF_PREFIX)) { zerr("redirection with no command", NULL, 0); errflag = lastval = 1; return; + } else if (!nullcmd || !*nullcmd || opts[IGNORENULLCMD]) { + if (!args) + args = newlinklist(); + addlinknode(args, dupstring(":")); } else if (readnullcmd && *readnullcmd && ((Redir) peekfirst(redir))->type == READ && !nextnode(firstnode(redir))) { -- cgit 1.4.1