about summary refs log tree commit diff
diff options
context:
space:
mode:
authorBart Schaefer <barts@users.sourceforge.net>2005-02-02 04:51:13 +0000
committerBart Schaefer <barts@users.sourceforge.net>2005-02-02 04:51:13 +0000
commitfacf0309bb9c6a0f1fd3641f0006065789b4b7b8 (patch)
tree1009f34951742e6128407ee7f92b577c75c6552a
parentbac7c055c755a962c086827719d4547a6186cd8b (diff)
downloadzsh-facf0309bb9c6a0f1fd3641f0006065789b4b7b8.tar.gz
zsh-facf0309bb9c6a0f1fd3641f0006065789b4b7b8.tar.xz
zsh-facf0309bb9c6a0f1fd3641f0006065789b4b7b8.zip
20774: fix e.g. "FOO=BAR BAR=FOO echo" failure to unset FOO after finishing.
-rw-r--r--ChangeLog5
-rw-r--r--Src/exec.c4
2 files changed, 7 insertions, 2 deletions
diff --git a/ChangeLog b/ChangeLog
index 62270a2c1..4c785e8fc 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2005-02-01  Bart Schaefer  <schaefer@zsh.org>
+
+	* 20774: Src/exec.c: fix e.g. "FOO=BAR BAR=FOO echo" failure to
+	unset FOO after finishing.
+
 2005-02-01  Clint Adams  <clint@zsh.org>
 
 	* 20773: Completion/Unix/Command/_getconf: additional variables
diff --git a/Src/exec.c b/Src/exec.c
index b718903ab..abee8329e 100644
--- a/Src/exec.c
+++ b/Src/exec.c
@@ -2554,10 +2554,10 @@ save_params(Estate state, Wordcode pc, LinkList *restore_p, LinkList *remove_p)
 		copyparam(tpm, pm, 1);
 		pm = tpm;
 	    }
-	    addlinknode(*remove_p, s);
+	    addlinknode(*remove_p, dupstring(s));
 	    addlinknode(*restore_p, pm);
 	} else
-	    addlinknode(*remove_p, s);
+	    addlinknode(*remove_p, dupstring(s));
 
 	pc += (WC_ASSIGN_TYPE(ac) == WC_ASSIGN_SCALAR ?
 	       3 : WC_ASSIGN_NUM(ac) + 2);