Subject: Re: ZSH_SCRIPT
From: Peter Stephenson <[email-masked]>
To: [email-masked]
Date: Thu, 03 Mar 2016 17:37:30 +0000
List-Id: Zsh Workers List <zsh-workers.zsh.org>

On Thu, 3 Mar 2016 12:26:22 -0500
Greg Klanderman <[email-masked]> wrote:
> Peter/Bart do you think it needs both ztrdup()s?
> 
> in zsh_main():
>     zsh_script = ztrdup(runscript);
> 
> and in createparamtable():
>     setsparam("ZSH_SCRIPT", ztrdup(zsh_script));

I think it needs the second, because what you pass to a parameter needs
to be uniquely managed by that parameter, so it can't point to memory
that can be referenced another way.  I doubt it needs the first as well.

Actually, I don't see why you need a glboal for zsh_script at all.  It's
just there to pass runscript on so it can be set later.  That's better
done by passing arguments rather than globals.

pws