Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: typeset -T crash
- X-seq: zsh-workers 35998
- From: Mikael Magnusson <mikachu@xxxxxxxxx>
- To: Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx>
- Subject: Re: typeset -T crash
- Date: Wed, 5 Aug 2015 22:41:33 +0200
- Cc: zsh workers <zsh-workers@xxxxxxx>
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=rFWNkYrh94j5PjNb8BPkyG2Es61XaFDb2Mhy2Wny+t0=; b=YkUBSgdFOy5TAKF66Hl79ng45COGf20+BD3n5sJyyxDfZrcM30SbC/x6SEzCEKk/0I lOe+P5BCXjLypWCCVJoq76vlVRKn0M0jw8zrUZmomMD12sX88VxVicwnMhyginKq4TrQ mQJpfj7gCIB0eqdq+SoVM5Uo1DaNet7nUyl0vSIXpV7x+meUasZnCvWnj636/ulOSDvz 8hv+d6DQd4EwZopxVn/AXe79Rwgkxwm2KesCR+yP+gon7dTP4kkqW3uhhRvaE50FhTfr eXUeq8xVAWusihf4mvOvL1NgsasIcWgMT6ihHRLTnjEIvby3GEliNIQKeFJKVi5l/ovd QHXQ==
- In-reply-to: <150805130412.ZM7660@torch.brasslantern.com>
- List-help: <mailto:zsh-workers-help@zsh.org>
- List-id: Zsh Workers List <zsh-workers.zsh.org>
- List-post: <mailto:zsh-workers@zsh.org>
- Mailing-list: contact zsh-workers-help@xxxxxxx; run by ezmlm
- References: <CAHYJk3Thbi1rbT02_QzSMjjiqpSVQ3awtEkGi0nYHrY8ZbAPnA@mail.gmail.com> <150805130412.ZM7660@torch.brasslantern.com>
On Wed, Aug 5, 2015 at 10:04 PM, Bart Schaefer
<schaefer@xxxxxxxxxxxxxxxx> wrote:
> On Aug 5, 7:59pm, Mikael Magnusson wrote:
> } Subject: typeset -T crash
> }
> } typeset -T i j k; typeset -T j i k
>
> Something like this?
Well, I suppose just checking tdp there works, but should we be
getting there at all? The error message also seems wrong since while
the array is already tied, we're trying to tie it as a scalar to its
tied scalar passed in the array position... (And in case anyone
overlooked it, the i and j are swapped in the above command, I could
probably have picked better letters).
> diff --git a/Src/builtin.c b/Src/builtin.c
> index a08a7d4..b32d679 100644
> --- a/Src/builtin.c
> +++ b/Src/builtin.c
> @@ -2680,10 +2680,15 @@ bin_typeset(char *name, char **argv, LinkList assigns, Options ops, int func)
> */
> struct tieddata *tdp = (struct tieddata*)pm->u.data;
> /* Update join character */
> - tdp->joinchar = joinchar;
> - if (asg0.value.scalar)
> - setsparam(asg0.name, ztrdup(asg0.value.scalar));
> - return 0;
> + if (tdp) {
> + tdp->joinchar = joinchar;
> + if (asg0.value.scalar)
> + setsparam(asg0.name, ztrdup(asg0.value.scalar));
> + return 0;
> + } else {
> + zwarnnam(name, "can't tie already tied array: %s",
> + asg0.name);
> + }
> } else {
> zwarnnam(name, "can't tie already tied scalar: %s",
> asg0.name);
--
Mikael Magnusson
Messages sorted by:
Reverse Date,
Date,
Thread,
Author