From f8b0dee88051065d4667fe41dd1bc81905c2b07c Mon Sep 17 00:00:00 2001 From: Tanaka Akira Date: Wed, 24 Nov 1999 16:20:58 +0000 Subject: zsh-workers/8770 --- Src/exec.c | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) (limited to 'Src/exec.c') diff --git a/Src/exec.c b/Src/exec.c index 9ee1c313f..0bc8ff923 100644 --- a/Src/exec.c +++ b/Src/exec.c @@ -1504,13 +1504,12 @@ execcmd(Cmd cmd, int input, int output, int how, int last1) } if (!(hn->flags & BINF_PREFIX)) { is_builtin = 1; -#ifdef DYNAMIC + /* autoload the builtin if necessary */ if (!((Builtin) hn)->handlerfunc) { load_module(((Builtin) hn)->optstr); hn = builtintab->getnode(builtintab, cmdarg); } -#endif assign = (hn->flags & BINF_MAGICEQUALS); break; } @@ -1619,13 +1618,12 @@ execcmd(Cmd cmd, int input, int output, int how, int last1) } if (!(hn->flags & BINF_PREFIX)) { is_builtin = 1; -#ifdef DYNAMIC + /* autoload the builtin if necessary */ if (!((Builtin) hn)->handlerfunc) { load_module(((Builtin) hn)->optstr); hn = builtintab->getnode(builtintab, cmdarg); } -#endif break; } cflags &= ~BINF_BUILTIN & ~BINF_COMMAND; @@ -3072,11 +3070,11 @@ runshfunc(List list, FuncWrap wrap, char *name) wrap->module->wrapper++; cont = wrap->handler(list, wrap->next, name); wrap->module->wrapper--; -#ifdef DYNAMIC + if (!wrap->module->wrapper && (wrap->module->flags & MOD_UNLOAD)) - unload_module(wrap->module, NULL); -#endif + unload_module(wrap->module, NULL, 0); + if (!cont) return; wrap = wrap->next; -- cgit 1.4.1