Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

PATCH: noerrs, this time it's for real



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



Messages sorted by: Reverse Date, Date, Thread, Author