zsh-workers
 help / color / mirror / code / Atom feed
From: Bart Schaefer <schaefer@brasslantern.com>
To: zsh workers <zsh-workers@zsh.org>
Subject: Re: typeset -T crash
Date: Wed, 5 Aug 2015 13:04:12 -0700	[thread overview]
Message-ID: <150805130412.ZM7660@torch.brasslantern.com> (raw)
In-Reply-To: <CAHYJk3Thbi1rbT02_QzSMjjiqpSVQ3awtEkGi0nYHrY8ZbAPnA@mail.gmail.com>

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?

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);


  reply	other threads:[~2015-08-05 20:04 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-08-05 17:59 Mikael Magnusson
2015-08-05 20:04 ` Bart Schaefer [this message]
2015-08-05 20:41   ` Mikael Magnusson
2015-08-06  0:35     ` Bart Schaefer
2015-08-09 17:56 ` Peter Stephenson
2015-08-09 19:31   ` Mikael Magnusson

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=150805130412.ZM7660@torch.brasslantern.com \
    --to=schaefer@brasslantern.com \
    --cc=zsh-workers@zsh.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).