fix zmodload -uf for not-yet-loaded function

This commit is contained in:
Peter Stephenson 2001-05-18 15:23:08 +00:00
parent 11e3147466
commit 4544933427
2 changed files with 10 additions and 3 deletions

View File

@ -1,3 +1,8 @@
2001-05-18 Peter Stephenson <pws@csr.com>
* 14382: Src/module.c: zmodload -uf wouldn't work even if the
math function hadn't been loaded yet.
2001-05-18 Sven Wischnowsky <wischnow@zsh.org>
* 14381: Src/subst.c: try to make ${(e)..} work for complicated

View File

@ -1346,7 +1346,7 @@ bin_zmodload_math(char *nam, char **args, char *ops)
int ret = 0;
if (ops['u']) {
/* remove autoloaded conditions */
/* remove autoloaded math functions */
for (; *args; args++) {
MathFunc f = getmathfunc(*args, 0);
@ -1355,7 +1355,7 @@ bin_zmodload_math(char *nam, char **args, char *ops)
zwarnnam(nam, "%s: no such math function", *args, 0);
ret = 1;
}
} else if (f->flags & CONDF_ADDED) {
} else if (f->flags & MFF_ADDED) {
zwarnnam(nam, "%s: math function is already defined", *args, 0);
ret = 1;
} else
@ -1377,7 +1377,7 @@ bin_zmodload_math(char *nam, char **args, char *ops)
}
return 0;
} else {
/* add autoloaded conditions */
/* add autoloaded math functions */
char *modnam;
modnam = *args++;
@ -2119,6 +2119,8 @@ add_automathfunc(char *nam, char *module)
return 1;
}
f->flags &= ~MFF_ADDED; /* still to autoload, not added yet */
return 0;
}