about summary refs log tree commit diff
diff options
context:
space:
mode:
-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);