diff options
author | jilles <jilles@FreeBSD.org> | 2009-12-24 15:14:22 +0000 |
---|---|---|
committer | jilles <jilles@FreeBSD.org> | 2009-12-24 15:14:22 +0000 |
commit | 979a1ef888d4a268658576bcd3793a3a47bb707d (patch) | |
tree | ac09eb24e922c647beec91bfabcc7667760f0fae /bin/sh/var.c | |
parent | ab355c0d662d8fd56d0d6d17844eb0e1620d0f30 (diff) | |
download | FreeBSD-src-979a1ef888d4a268658576bcd3793a3a47bb707d.zip FreeBSD-src-979a1ef888d4a268658576bcd3793a3a47bb707d.tar.gz |
sh: Remove setting variables from dotcmd/exportcmd.
It is already done by evalcommand(), unless special-ness has been removed,
in which case variable assignments should not persist. (These are currently
always special builtins, but this will change later: command builtin,
command substitution.)
This also fixes a memory leak when calling . with variable assignments.
Example:
valgrind --leak-check=full sh -c 'x=1 . /dev/null; x=2'
Diffstat (limited to 'bin/sh/var.c')
-rw-r--r-- | bin/sh/var.c | 1 |
1 files changed, 0 insertions, 1 deletions
diff --git a/bin/sh/var.c b/bin/sh/var.c index 6caf956..8fa3b5c 100644 --- a/bin/sh/var.c +++ b/bin/sh/var.c @@ -607,7 +607,6 @@ exportcmd(int argc, char **argv) if (values && argc != 0) error("-p requires no arguments"); - listsetvar(cmdenviron); if (argc != 0) { while ((name = *argv++) != NULL) { if ((p = strchr(name, '=')) != NULL) { |