Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: PATCH: Re: Really wierd problems with autoload
- X-seq: zsh-workers 10352
- From: Sven Wischnowsky <wischnow@xxxxxxxxxxxxxxxxxxxxxxx>
- To: zsh-workers@xxxxxxxxxxxxxx
- Subject: Re: PATCH: Re: Really wierd problems with autoload
- Date: Fri, 31 Mar 2000 09:29:07 +0200 (MET DST)
- In-reply-to: Sven Wischnowsky's message of Thu, 30 Mar 2000 13:32:34 +0200 (MET DST)
- Mailing-list: contact zsh-workers-help@xxxxxxxxxxxxxx; run by ezmlm
I wrote:
> Bart Schaefer wrote:
>
> ...
>
> > This used to work, but in 3.1.6-dev-20 when I type ESC-h I get
> >
> > run-help:9: run-help: function definition file not found
> >
> > Now, it's not run-help line 9, it's zman line 9;
>
> That's because we do autoloading via the execautofn() function. For
> the execution code, the function currently active is the dummy
> function created for autoloading the real function.
>
> The patch below makes doshfunc() set scriptname only if called for a
> real function and makes execautofn() handle the scriptname, too.
Grrrr, this didn't work for parse errors, of course.
Bye
Sven
diff -ru ../z.old/Src/exec.c Src/exec.c
--- ../z.old/Src/exec.c Fri Mar 31 09:18:49 2000
+++ Src/exec.c Fri Mar 31 09:25:12 2000
@@ -3420,11 +3420,15 @@
d = (char *) zalloc(len + 1);
lseek(fd, 0, 0);
if (read(fd, d, len) == len) {
+ char *oldscriptname = scriptname;
+
close(fd);
d[len] = '\0';
d = metafy(d, len, META_REALLOC);
+ scriptname = dupstring(s);
r = parse_string(d, 1);
+ scriptname = oldscriptname;
zfree(d, len + 1);
--
Sven Wischnowsky wischnow@xxxxxxxxxxxxxxxxxxxxxxx
Messages sorted by:
Reverse Date,
Date,
Thread,
Author