zsh-workers
 help / color / mirror / code / Atom feed
From: Sven Wischnowsky <wischnow@informatik.hu-berlin.de>
To: zsh-workers@sunsite.auc.dk
Subject: Re: autoload +X[zk]
Date: Mon, 27 Mar 2000 13:27:55 +0200 (MET DST)	[thread overview]
Message-ID: <200003271127.NAA05593@beta.informatik.hu-berlin.de> (raw)
In-Reply-To: Sven Wischnowsky's message of Mon, 27 Mar 2000 12:49:28 +0200 (MET DST)


Sorrysorrysorry, just found a bug in this patch.


Bye
 Sven

diff -ru ../z.old/Src/builtin.c Src/builtin.c
--- ../z.old/Src/builtin.c	Mon Mar 27 13:05:36 2000
+++ Src/builtin.c	Mon Mar 27 13:21:31 2000
@@ -2016,7 +2016,7 @@
 	return bin_eval(name, fargv, ops, func);
     }
 
-    return loadautofn(shf, (ops['k'] ? 2 : (ops['z'] ? 0 : 1)));
+    return !loadautofn(shf, (ops['k'] ? 2 : (ops['z'] ? 0 : 1)));
 }
 
 /* Display or change the attributes of shell functions.   *
diff -ru ../z.old/Src/exec.c Src/exec.c
--- ../z.old/Src/exec.c	Mon Mar 27 13:05:36 2000
+++ Src/exec.c	Mon Mar 27 13:25:21 2000
@@ -3166,16 +3166,17 @@
 static int
 execautofn(Estate state, int do_exec)
 {
-    if (loadautofn(state->prog->shf, 1))
-	return 1;
+    Shfunc shf;
 
+    if (!(shf = loadautofn(state->prog->shf, 1)))
+	return 1;
 
-    execode(state->prog->shf->funcdef, 1, 0);
+    execode(shf->funcdef, 1, 0);
     return lastval;
 }
 
 /**/
-int
+Shfunc
 loadautofn(Shfunc shf, int fksh)
 {
     int noalias = noaliases, ksh = 1;
@@ -3193,7 +3194,7 @@
     if (prog == &dummy_eprog) {
 	zerr("%s: function definition file not found", shf->nam, 0);
 	popheap();
-	return 1;
+	return NULL;
     }
     if (!prog)
 	prog = &dummy_eprog;
@@ -3202,10 +3203,10 @@
 	strcpy(n, shf->nam);
 	execode(prog, 1, 0);
 	shf = (Shfunc) shfunctab->getnode(shfunctab, n);
-	if(!shf || (shf->flags & PM_UNDEFINED)) {
+	if (!shf || (shf->flags & PM_UNDEFINED)) {
 	    zerr("%s: function not defined by file", n, 0);
 	    popheap();
-	    return 1;
+	    return NULL;
 	}
     } else {
 	freeeprog(shf->funcdef);
@@ -3217,7 +3218,7 @@
     }
     popheap();
 
-    return 0;
+    return shf;
 }
 
 /* execute a shell function */

--
Sven Wischnowsky                         wischnow@informatik.hu-berlin.de


             reply	other threads:[~2000-03-27 11:28 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2000-03-27 11:27 Sven Wischnowsky [this message]
  -- strict thread matches above, loose matches on Subject: below --
2000-03-28 11:52 Sven Wischnowsky
2000-03-28 14:10 ` Sven Wischnowsky
2000-03-28 18:27   ` Bart Schaefer
2000-03-28 11:40 Sven Wischnowsky
2000-03-27 10:49 Sven Wischnowsky
2000-03-27 16:48 ` Bart Schaefer

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=200003271127.NAA05593@beta.informatik.hu-berlin.de \
    --to=wischnow@informatik.hu-berlin.de \
    --cc=zsh-workers@sunsite.auc.dk \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).