From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 282 invoked from network); 17 Mar 1999 13:21:04 -0000 Received: from sunsite.auc.dk (130.225.51.30) by ns1.primenet.com.au with SMTP; 17 Mar 1999 13:21:04 -0000 Received: (qmail 26679 invoked by alias); 17 Mar 1999 13:20:24 -0000 Mailing-List: contact zsh-workers-help@sunsite.auc.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 5844 Received: (qmail 26671 invoked from network); 17 Mar 1999 13:20:22 -0000 Message-Id: <9903171304.AA17840@ibmth.df.unipi.it> To: zsh-workers@sunsite.auc.dk (Zsh hackers list) Subject: PATCH: noerrs, this time it's for real Date: Wed, 17 Mar 1999 14:04:18 +0100 From: Peter Stephenson Bart's patch to set errflag even if noerrs was caused problems in createparamtable() if an imported parameter was marked internally as restricted. The resulting errflag caused matheval() to fail, so my SHLVL was always being reset to 0 (then incremented to 1, which was the error I first saw). It would make sense in this particular case to check for PM_RESTRICTED when importing and so reject it earlier without creating an error, but the experience is enough for me to suggest that noerrs have a `really no errors' mode, used in the main shell code, leaving zle (where the original problems were) as it was. This patch depends on that one, repeated in 5783 (pass that through sed -e 's/^} //' before patching). --- Src/init.c.errs Thu Mar 11 11:20:39 1999 +++ Src/init.c Wed Mar 17 13:49:10 1999 @@ -743,7 +743,7 @@ char *s = getsparam("ENV"); if (islogin) sourcehome(".profile"); - noerrs = 1; + noerrs = 2; if (s && !parsestr(s)) { singsub(&s); noerrs = 0; --- Src/params.c.errs Wed Mar 3 15:13:14 1999 +++ Src/params.c Wed Mar 17 13:48:16 1999 @@ -413,7 +413,7 @@ argvparam = (Param) paramtab->getnode(paramtab, "*"); - noerrs = 1; + noerrs = 2; HEAPALLOC { /* Add the standard non-special parameters which have to * --- Src/utils.c.errs Mon Mar 15 10:54:31 1999 +++ Src/utils.c Wed Mar 17 13:49:38 1999 @@ -53,7 +53,8 @@ zerr(const char *fmt, const char *str, int num) { if (errflag || noerrs) { - errflag = 1; + if (noerrs < 2) + errflag = 1; return; } errflag = 1; @@ -1308,7 +1309,7 @@ return; guess = dupstring(guess); ne = noerrs; - noerrs = 1; + noerrs = 2; singsub(&guess); noerrs = ne; if (!guess) -- Peter Stephenson Tel: +39 050 844536 WWW: http://www.ifh.de/~pws/ Dipartimento di Fisica, Via Buonarroti 2, 56127 Pisa, Italy