Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
PATCH: RE: Module aliases don't work in static zsh
- X-seq: zsh-workers 12525
- From: Sven Wischnowsky <wischnow@xxxxxxxxxxxxxxxxxxxxxxx>
- To: zsh-workers@xxxxxxxxxxxxxx
- Subject: PATCH: RE: Module aliases don't work in static zsh
- Date: Fri, 4 Aug 2000 09:52:08 +0200 (MET DST)
- In-reply-to: "Andrej Borsenkow"'s message of Fri, 4 Aug 2000 11:10:59 +0400
- Mailing-list: contact zsh-workers-help@xxxxxxxxxxxxxx; run by ezmlm
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.
Ouch.
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).
Bye
Sven
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