diff options
| author | Peter Stephenson <p.w.stephenson@ntlworld.com> | 2015-01-18 22:38:57 +0000 |
|---|---|---|
| committer | Peter Stephenson <p.w.stephenson@ntlworld.com> | 2015-01-18 22:38:57 +0000 |
| commit | c6c9f5daf2e196e6ab7346dfbf5f5166a1d87f0c (patch) | |
| tree | de064fa6ba629549d42868b7016dd3c28bfb0e34 /Src/init.c | |
| parent | Fix X-Seq (diff) | |
| download | zsh-c6c9f5daf2e196e6ab7346dfbf5f5166a1d87f0c.tar zsh-c6c9f5daf2e196e6ab7346dfbf5f5166a1d87f0c.tar.gz zsh-c6c9f5daf2e196e6ab7346dfbf5f5166a1d87f0c.tar.bz2 zsh-c6c9f5daf2e196e6ab7346dfbf5f5166a1d87f0c.tar.lz zsh-c6c9f5daf2e196e6ab7346dfbf5f5166a1d87f0c.tar.xz zsh-c6c9f5daf2e196e6ab7346dfbf5f5166a1d87f0c.tar.zst zsh-c6c9f5daf2e196e6ab7346dfbf5f5166a1d87f0c.zip | |
34322: bug with interface to parsestr() etc.
Was showing up in places like ${(e)...} where command substitution
could reallocate the token string, but actually there was never any
guarantee that the lexer wouldn't do that, so this was always
a bit iffy.
Diffstat (limited to 'Src/init.c')
| -rw-r--r-- | Src/init.c | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/Src/init.c b/Src/init.c index e7d86feac..3e41fb9dd 100644 --- a/Src/init.c +++ b/Src/init.c @@ -1197,10 +1197,13 @@ run_init_scripts(void) if (islogin) sourcehome(".profile"); noerrs = 2; - if (s && !parsestr(s)) { - singsub(&s); - noerrs = 0; - source(s); + if (s) { + s = dupstring(s); + if (!parsestr(&s)) { + singsub(&s); + noerrs = 0; + source(s); + } } noerrs = 0; } else |
