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

PATCH: RE: Module aliases don't work in static zsh

Andrej Borsenkow wrote:

> > I.e. you've got to do `zmodload zsh/files' rather than `zmodload files'.
> > We should either toss out module aliases entirely, even from dynamic zsh,
> > or make them work (and work better).
> Actually it looks like builtin module's boot/setup are never executed unless
> you have some auto(builtin|condition|parameter) defined. zmodload calls
> bin_zmodload_load() that calls require_module() that checks if module is on
> linked in list and exits. But actual initialisation takes place in
> load_module() that is not called in this case.

That would have been true if the test had been correct. But it was
comparing strings with pointers to the linedmod structs.


How embarrassing.

Thanks for pointing that out.

> And it is the function that is
> called in every other place where module is needed.

Because they are the autoloading places where we know that the module
is not yet loaded (otherwise the thing wouldn't still be autoloaded).


Index: Src/module.c
RCS file: /cvsroot/zsh/zsh/Src/module.c,v
retrieving revision 1.4
diff -u -r1.4 module.c
--- Src/module.c	2000/06/02 08:28:43	1.4
+++ Src/module.c	2000/08/04 07:51:24
@@ -778,11 +778,6 @@
     Module m = NULL;
     LinkNode node;
-    /* First see if the module is linked in. */
-    for (node = firstnode(linkedmodules); node; incnode(node)) {
-	if (!strcmp((char *) getdata(node), nam))
-	    return 1;
-    }
     node = find_module(module);
     if (node && (m = ((Module) getdata(node)))->u.handle &&
 	!(m->flags & MOD_UNLOAD)) {

Sven Wischnowsky                         wischnow@xxxxxxxxxxxxxxxxxxxxxxx

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