From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 17742 invoked from network); 31 Mar 2000 07:29:40 -0000 Received: from sunsite.auc.dk (130.225.51.30) by ns1.primenet.com.au with SMTP; 31 Mar 2000 07:29:40 -0000 Received: (qmail 19818 invoked by alias); 31 Mar 2000 07:29:29 -0000 Mailing-List: contact zsh-workers-help@sunsite.auc.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 10352 Received: (qmail 19717 invoked from network); 31 Mar 2000 07:29:17 -0000 Date: Fri, 31 Mar 2000 09:29:07 +0200 (MET DST) Message-Id: <200003310729.JAA08390@beta.informatik.hu-berlin.de> From: Sven Wischnowsky To: zsh-workers@sunsite.auc.dk In-reply-to: Sven Wischnowsky's message of Thu, 30 Mar 2000 13:32:34 +0200 (MET DST) Subject: Re: PATCH: Re: Really wierd problems with autoload 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@informatik.hu-berlin.de