zsh-workers
 help / color / mirror / code / Atom feed
From: Peter Stephenson <pws@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	[thread overview]
Message-ID: <9903171304.AA17840@ibmth.df.unipi.it> (raw)

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 <pws@ibmth.df.unipi.it>       Tel: +39 050 844536
WWW:  http://www.ifh.de/~pws/
Dipartimento di Fisica, Via Buonarroti 2, 56127 Pisa, Italy


             reply	other threads:[~1999-03-17 13:21 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1999-03-17 13:04 Peter Stephenson [this message]
1999-03-17 16:43 ` Bart Schaefer
1999-03-17 16:44   ` Peter Stephenson

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=9903171304.AA17840@ibmth.df.unipi.it \
    --to=pws@ibmth.df.unipi.it \
    --cc=zsh-workers@sunsite.auc.dk \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).