From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 29534 invoked from network); 19 Jan 2000 12:51:38 -0000 Received: from sunsite.auc.dk (130.225.51.30) by ns1.primenet.com.au with SMTP; 19 Jan 2000 12:51:38 -0000 Received: (qmail 11317 invoked by alias); 19 Jan 2000 12:51:31 -0000 Mailing-List: contact zsh-workers-help@sunsite.auc.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 9367 Received: (qmail 11310 invoked from network); 19 Jan 2000 12:51:31 -0000 To: zsh-workers@sunsite.auc.dk Subject: Re: If someone wants to try... In-reply-to: "Peter Stephenson"'s message of "Wed, 19 Jan 2000 12:48:50 GMT." Date: Wed, 19 Jan 2000 12:53:56 +0000 From: Peter Stephenson Message-Id: Peter Stephenson wrote: > I've found three problems, described and supposedly fixed below. Sorry, I sent an early version of the patch. Ignore it and use this. Rationale as before. --- Src/cond.c.cond Tue Jan 18 22:01:34 2000 +++ Src/cond.c Wed Jan 19 11:18:08 2000 @@ -43,7 +43,8 @@ { struct stat *st; char *left, *right = NULL; - wordcode code = *state->pc++; + Wordcode pcode = state->pc++; + wordcode code = *pcode; int ctype = WC_COND_TYPE(code); switch (ctype) { @@ -57,7 +58,7 @@ fprintf(stderr, " %s", condstr[ctype]); return evalcond(state); } else { - state->pc += WC_COND_SKIP(code) - 1; + state->pc = pcode + (WC_COND_SKIP(code) + 1); return 0; } case COND_OR: @@ -66,7 +67,7 @@ fprintf(stderr, " %s", condstr[ctype]); return evalcond(state); } else { - state->pc += WC_COND_SKIP(code) - 1; + state->pc = pcode + (WC_COND_SKIP(code) + 1); return 1; } case COND_MOD: --- Src/parse.c.cond Tue Jan 18 21:35:08 2000 +++ Src/parse.c Wed Jan 19 12:24:56 2000 @@ -1727,7 +1727,7 @@ * Word code layout: * * WC_END - * - only used for empty functions + * - end of program code * * WC_LIST * - data contains type (sync, ...) @@ -2217,6 +2217,14 @@ } } break; + case N_COND: + eccond((Cond) n); + break; +#ifdef DEBUG + default: + dputs("BUG: node type not handled in ecomp()."); + break; +#endif } } @@ -2335,8 +2343,7 @@ ecsoffs = ecnpats = 0; ec(list); - if (!ecused) - ecadd(WCB_END()); + ecadd(WCB_END()); ret = (Eprog) zhalloc(sizeof(*ret)); ret->len = ((ecnpats * sizeof(Patprog)) + --- Test/04redirect.ztst.cond Wed Jan 19 12:38:52 2000 +++ Test/04redirect.ztst Wed Jan 19 12:40:15 2000 @@ -191,6 +191,11 @@ 1:null redir with NULLCMD unset ?ZTST_execchunk:2: redirection with no command + echo this should still work >out1 + print "$(this should still work + READNULLCMD=cat print cat input >out1