diff options
author | Tanaka Akira <akr@users.sourceforge.net> | 2000-03-14 11:14:54 +0000 |
---|---|---|
committer | Tanaka Akira <akr@users.sourceforge.net> | 2000-03-14 11:14:54 +0000 |
commit | 05b1db3387e8c54368e43b5c5169fb7daab25c54 (patch) | |
tree | f82d1a236bfe25634666ca2782e398258b3c8c14 /Src/builtin.c | |
parent | e91bdf82c9c7b9589bfd813cd7f571d50090f05b (diff) | |
download | zsh-05b1db3387e8c54368e43b5c5169fb7daab25c54.tar.gz zsh-05b1db3387e8c54368e43b5c5169fb7daab25c54.tar.xz zsh-05b1db3387e8c54368e43b5c5169fb7daab25c54.zip |
zsh-workers/10129
Diffstat (limited to 'Src/builtin.c')
-rw-r--r-- | Src/builtin.c | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/Src/builtin.c b/Src/builtin.c index 90ca5133c..73876b1fa 100644 --- a/Src/builtin.c +++ b/Src/builtin.c @@ -43,7 +43,7 @@ static struct builtin builtins[] = BUILTIN(".", BINF_PSPECIAL, bin_dot, 1, -1, 0, NULL, NULL), BUILTIN(":", BINF_PSPECIAL, bin_true, 0, -1, 0, NULL, NULL), BUILTIN("alias", BINF_MAGICEQUALS | BINF_PLUSOPTS, bin_alias, 0, -1, 0, "Lgmr", NULL), - BUILTIN("autoload", BINF_TYPEOPTS, bin_functions, 0, -1, 0, "tUX", "u"), + BUILTIN("autoload", BINF_TYPEOPTS, bin_functions, 0, -1, 0, "tUXw", "u"), BUILTIN("bg", 0, bin_fg, 0, -1, BIN_BG, NULL, NULL), BUILTIN("break", BINF_PSPECIAL, bin_break, 0, 1, BIN_BREAK, NULL, NULL), BUILTIN("bye", 0, bin_break, 0, 1, BIN_EXIT, NULL, NULL), @@ -1996,7 +1996,8 @@ bin_typeset(char *name, char **argv, char *ops, int func) /* Helper for bin_functions() when run as "autoload -X" */ -static int +/**/ +int eval_autoload(Shfunc shf, char *name, char *ops, int func) { if (!(shf->flags & PM_UNDEFINED)) @@ -2114,7 +2115,12 @@ bin_functions(char *name, char **argv, char *ops, int func) /* Take the arguments literally -- do not glob */ for (; *argv; argv++) { - if ((shf = (Shfunc) shfunctab->getnode(shfunctab, *argv))) { + if (ops['w']) { + if (dump_autoload(*argv, on, ops, func)) { + zwarnnam(name, "invalid wordcode file: %s", *argv, 0); + returnval = 1; + } + } else if ((shf = (Shfunc) shfunctab->getnode(shfunctab, *argv))) { /* if any flag was given */ if (on|off) { /* turn on/off the given flags */ @@ -2140,7 +2146,7 @@ bin_functions(char *name, char **argv, char *ops, int func) } /**/ -static Eprog +Eprog mkautofn(Shfunc shf) { Eprog p; |