summaryrefslogtreecommitdiffstats
path: root/Src/exec.c
diff options
context:
space:
mode:
authorTanaka Akira <akr@users.sourceforge.net>1999-10-25 09:34:23 +0000
committerTanaka Akira <akr@users.sourceforge.net>1999-10-25 09:34:23 +0000
commit1fe3b5622443f16f1d64a250a648db595090670a (patch)
tree8ae49f263de648900eb54ef85beeee410e18df22 /Src/exec.c
parentzsh-workers/8400 (diff)
downloadzsh-1fe3b5622443f16f1d64a250a648db595090670a.tar
zsh-1fe3b5622443f16f1d64a250a648db595090670a.tar.gz
zsh-1fe3b5622443f16f1d64a250a648db595090670a.tar.bz2
zsh-1fe3b5622443f16f1d64a250a648db595090670a.tar.lz
zsh-1fe3b5622443f16f1d64a250a648db595090670a.tar.xz
zsh-1fe3b5622443f16f1d64a250a648db595090670a.tar.zst
zsh-1fe3b5622443f16f1d64a250a648db595090670a.zip
zsh-workers/8404
Diffstat (limited to 'Src/exec.c')
-rw-r--r--Src/exec.c29
1 files changed, 27 insertions, 2 deletions
diff --git a/Src/exec.c b/Src/exec.c
index 69a34254e..53cff375d 100644
--- a/Src/exec.c
+++ b/Src/exec.c
@@ -2911,11 +2911,11 @@ execautofn(Cmd cmd, LinkList args, int flags)
l = getfpfunc(shf->nam);
noaliases = noalias;
- if(l == &dummy_list) {
+ if (l == &dummy_list) {
zerr("%s: function definition file not found", shf->nam, 0);
return 1;
}
- if(isset(KSHAUTOLOAD)) {
+ if (isset(KSHAUTOLOAD)) {
VARARR(char, n, strlen(shf->nam) + 1);
strcpy(n, shf->nam);
execlist(l, 1, 0);
@@ -2935,6 +2935,31 @@ execautofn(Cmd cmd, LinkList args, int flags)
return lastval;
}
+/**/
+int
+loadautofn(Shfunc shf)
+{
+ /* Copied from execautofn() -- should consolidate someday */
+
+ int noalias = noaliases;
+ List l;
+
+ noaliases = (shf->flags & PM_UNALIASED);
+ l = getfpfunc(shf->nam);
+ noaliases = noalias;
+
+ if (l == &dummy_list) {
+ zerr("%s: function definition file not found", shf->nam, 0);
+ return 1;
+ }
+ PERMALLOC {
+ shf->funcdef = dupstruct(stripkshdef(l, shf->nam));
+ } LASTALLOC;
+ shf->flags &= ~PM_UNDEFINED;
+
+ return 0;
+}
+
/* execute a shell function */
/**/