Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: putenv()/environ bug



On Mon, 30 Jul 2007, Peter Stephenson wrote:

Paranoia.

Index: Test/B02typeset.ztst
===================================================================
RCS file: /cvsroot/zsh/zsh/Test/B02typeset.ztst,v
retrieving revision 1.13
diff -u -r1.13 B02typeset.ztst
--- Test/B02typeset.ztst	28 May 2007 22:57:42 -0000	1.13
+++ Test/B02typeset.ztst	30 Jul 2007 20:52:56 -0000
@@ -377,3 +377,14 @@
>integer local i
>local tagged scalar
>preserved
+
+ export ENVFOO=bar
+ print ENVFOO in environment
+ env | grep '^ENVFOO'
+ unset ENVFOO
+ print ENVFOO no longer in environment
+ env | grep '^ENVFOO'
+1:Adding and removing values to and from the environment
+>ENVFOO in environment
+>ENVFOO=bar
+>ENVFOO no longer in environment

This test would work even before the patch.  The issue only showed up if
zsh was executed again.

Example:
zsh
export FOO=BAR
exec zsh
unset FOO
env | grep FOO
echo $FOO

Sean
--
scf@xxxxxxxxxxx



Messages sorted by: Reverse Date, Date, Thread, Author