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

Re: Static zsh aborts a function when zmodload is failed.



Tanaka Akira wrote:

> Static version of zsh aborts a function when zmodload is failed as:
> 
> Z(2):akr@is27e1u11% ./configure --prefix=/space/akr/zsh/zz --disable-dynamic&& make && make install
> ...
> Z(2):akr@is27e1u11% Src/zsh -f
> is27e1u11% tst () { print A; zmodload xxx; print B }
> is27e1u11% tst
> A
> tst: failed to load module: xxx
> is27e1u11% 
> 
> I think zsh should prints `B' as follows:
> 
> Z(2):akr@is27e1u11% Src/zsh -f
> is27e1u11% tst () { print A; zmodload xxx; print B }
> is27e1u11% tst
> A
> tst: failed to load module: xxx
> B
> is27e1u11% 
> 
> Dynamic version works well.

errflag wasn't restored in the static version of do_load_module().

Bye
 Sven

diff -ru ../z.old/Src/module.c Src/module.c
--- ../z.old/Src/module.c	Fri Jan 14 09:26:46 2000
+++ Src/module.c	Fri Jan 14 09:27:47 2000
@@ -424,7 +424,10 @@
 static void *
 do_load_module(char const *name)
 {
+    int waserr = errflag;
+
     zerr("failed to load module: %s", name, 0);
+    errflag = waserr;
 
     return NULL;
 }

--
Sven Wischnowsky                         wischnow@xxxxxxxxxxxxxxxxxxxxxxx



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