From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 778 invoked from network); 10 Apr 2000 09:09:17 -0000 Received: from sunsite.auc.dk (130.225.51.30) by ns1.primenet.com.au with SMTP; 10 Apr 2000 09:09:17 -0000 Received: (qmail 11804 invoked by alias); 10 Apr 2000 09:09:07 -0000 Mailing-List: contact zsh-workers-help@sunsite.auc.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 10620 Received: (qmail 11791 invoked from network); 10 Apr 2000 09:09:07 -0000 Date: Mon, 10 Apr 2000 11:09:04 +0200 (MET DST) Message-Id: <200004100909.LAA00065@beta.informatik.hu-berlin.de> From: Sven Wischnowsky To: zsh-workers@sunsite.auc.dk In-reply-to: "Bart Schaefer"'s message of Mon, 10 Apr 2000 05:46:49 +0000 Subject: PATCH: Re: PS4 is hosed in -dev-22 Bart Schaefer wrote: > I have > > PS4='+%1N:%i%1(_.:%_.): ' > > This used to display e.g. > > zagzig<3> echo bar > +zsh-3.1.6-dev-20:3: echo bar > > Now it displays: > > zagzig<3> echo bar > + :3: echo bar > > (There's a huge amount of whitespace between the `+' and the `:', in case > your mail viewer has wrapped the line.) My fault. doshfunc() didn't reset scriptname correctly. Bye Sven Index: Src/exec.c =================================================================== RCS file: /cvsroot/zsh/zsh/Src/exec.c,v retrieving revision 1.4 diff -u -r1.4 exec.c --- Src/exec.c 2000/04/07 15:40:21 1.4 +++ Src/exec.c 2000/04/10 09:08:16 @@ -3249,7 +3249,7 @@ { char **tab, **x, *oargv0; int oldzoptind, oldlastval, oldoptcind; - char saveopts[OPT_SIZE], *oldscriptname = NULL, *fname = dupstring(name); + char saveopts[OPT_SIZE], *oldscriptname = scriptname, *fname = dupstring(name); int obreaks; struct funcstack fstack; #ifdef MAX_FUNCTION_DEPTH @@ -3267,10 +3267,8 @@ starttrapscope(); tab = pparams; - if (!(flags & PM_UNDEFINED)) { - oldscriptname = scriptname; + if (!(flags & PM_UNDEFINED)) scriptname = dupstring(name); - } oldzoptind = zoptind; zoptind = 1; oldoptcind = optcind; @@ -3308,6 +3306,8 @@ if(++funcdepth > MAX_FUNCTION_DEPTH) { zerr("maximum nested function level reached", NULL, 0); + scriptname = oldscriptname; + popheap(); return; } #endif @@ -3328,6 +3328,7 @@ if (!noreturnval) lastval = 1; popheap(); + scriptname = oldscriptname; return; } prog = shf->funcdef; @@ -3349,8 +3350,7 @@ pparams = tab; optcind = oldoptcind; zoptind = oldzoptind; - if (oldscriptname) - scriptname = oldscriptname; + scriptname = oldscriptname; if (isset(LOCALOPTIONS)) { /* restore all shell options except PRIVILEGED and RESTRICTED */ -- Sven Wischnowsky wischnow@informatik.hu-berlin.de