]> CyberLeo.Net >> Repos - FreeBSD/stable/8.git/commit
MFC r200943: sh: Remove setting variables from dotcmd/exportcmd.
authorjilles <jilles@ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f>
Tue, 20 Apr 2010 22:32:34 +0000 (22:32 +0000)
committerjilles <jilles@ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f>
Tue, 20 Apr 2010 22:32:34 +0000 (22:32 +0000)
commit6b7239db7579436eea07fcef0303e4115027d214
treede93da86142c781a64d389e4d95b86d37fcd6eb8
parent8b30a14bf03461e756665cd908e9878dd45f0662
MFC r200943: 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 may 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'

git-svn-id: svn://svn.freebsd.org/base/stable/8@206944 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
bin/sh/main.c
bin/sh/var.c