Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: dirstack history: loving zsh, crashing zsh...
- X-seq: zsh-workers 22318
- From: Peter Stephenson <p.w.stephenson@xxxxxxxxxxxx>
- To: Francisco Borges <f.borges@xxxxxx>, zsh-workers@xxxxxxxxxx (Zsh hackers list)
- Subject: Re: dirstack history: loving zsh, crashing zsh...
- Date: Fri, 03 Mar 2006 22:23:54 +0000
- In-reply-to: Your message of "Thu, 02 Mar 2006 18:52:52 +0100." <20060302175252.GA31734@xxxxxxxxxx>
- Mailing-list: contact zsh-workers-help@xxxxxxxxxx; run by ezmlm
Francisco Borges wrote:
> % typeset -U dirstack
>
> and the shell crashed. (I kid you not!)
This fixes this one... however, there could be a lot of other places
where the consequences of manipulating a special array haven't been
thought through, so it would be good to keep a watch out.
Index: Src/builtin.c
===================================================================
RCS file: /cvsroot/zsh/zsh/Src/builtin.c,v
retrieving revision 1.152
diff -u -r1.152 builtin.c
--- Src/builtin.c 2 Mar 2006 22:05:25 -0000 1.152
+++ Src/builtin.c 3 Mar 2006 22:20:38 -0000
@@ -1924,8 +1924,9 @@
Param apm;
char **x;
if (PM_TYPE(pm->flags) == PM_ARRAY) {
- x = (*pm->gsu.a->getfn)(pm);
+ x = zarrdup((*pm->gsu.a->getfn)(pm));
uniqarray(x);
+ pm->gsu.a->setfn(pm, x);
if (pm->ename && x)
arrfixenv(pm->ename, x);
} else if (PM_TYPE(pm->flags) == PM_SCALAR && pm->ename &&
--
Peter Stephenson <p.w.stephenson@xxxxxxxxxxxx>
Web page still at http://www.pwstephenson.fsnet.co.uk/
Messages sorted by:
Reverse Date,
Date,
Thread,
Author