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

Re: Bug with _parameters and zmodload



Peter Stephenson wrote:
> Oliver Kiddle wrote:
> > I got a number of error messages of the following form:
> > 
> > _parameters: mapfile: autoload failed [43]
> > 
> > I get it for each of parameters, functions, options, commands and mapfile
> 
> This should fix this part.

Hmm, after thinking some more, maybe the following is a neater fix than
7616?  I don't see why you should have to autoload any module just to unset
a parameter that hasn't yet been loaded, which is supposed to be what the
following prevents.  The (paramtab == realparamtab) test makes sure it only
does the short cut for top level parameters, where we know what
paramtab->getnode does; I just copied it from createparam(), where I
presume it has a similar function (don't load a parameter if you're only
about to hide it).

--- Src/params.c.upm	Mon Aug 30 16:14:05 1999
+++ Src/params.c	Thu Sep  2 10:46:28 1999
@@ -1733,7 +1733,9 @@
 {
     Param pm;
 
-    if ((pm = (Param) paramtab->getnode(paramtab, s)))
+    if ((pm = (Param) (paramtab == realparamtab ?
+		       gethashnode2(paramtab, s) :
+		       paramtab->getnode(paramtab, s))))
 	unsetparam_pm(pm, 0, 1);
 }
 

-- 
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