Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: handling of variables
- X-seq: zsh-workers 20774
- From: Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx>
- To: zsh-workers@xxxxxxxxxx
- Subject: Re: handling of variables
- Date: Wed, 2 Feb 2005 03:47:54 +0000
- In-reply-to: <1050201164011.ZM9367@xxxxxxxxxxxxxxxxxxxxxxx>
- Mailing-list: contact zsh-workers-help@xxxxxxxxxx; run by ezmlm
- References: <2005-02-01T12-49-14@xxxxxxxxxxxxxxxxxxxxxxxxx> <200502011410.j11EAA9D029705@xxxxxxxxxxxxxx> <1050201152428.ZM9278@xxxxxxxxxxxxxxxxxxxxxxx> <1050201164011.ZM9367@xxxxxxxxxxxxxxxxxxxxxxx>
[moved to -workers]
On Feb 1, 4:40pm, Bart Schaefer wrote:
}
} I now think that exec.c:save_params() needs to copy the value returned
} by ecrawstr() before storing it in the restore_p linked list
That should say "remove_p" not "restore_p".
} but I'm not sure what kind of memory to copy it into
Got a chance to look at this again; addlinknode() uses the heap, so it
should be safe to dupstring() here.
And the following does indeed fix the problem.
Index: Src/exec.c
===================================================================
diff -c -r1.23 exec.c
--- Src/exec.c 13 Jan 2005 04:12:14 -0000 1.23
+++ Src/exec.c 2 Feb 2005 03:41:43 -0000
@@ -2554,10 +2554,10 @@
copyparam(tpm, pm, 1);
pm = tpm;
}
- addlinknode(*remove_p, s);
+ addlinknode(*remove_p, dupstring(s));
addlinknode(*restore_p, pm);
} else
- addlinknode(*remove_p, s);
+ addlinknode(*remove_p, dupstring(s));
pc += (WC_ASSIGN_TYPE(ac) == WC_ASSIGN_SCALAR ?
3 : WC_ASSIGN_NUM(ac) + 2);
Messages sorted by:
Reverse Date,
Date,
Thread,
Author