Use ENV_USER with vars set via function -a

ENV_USER is intended to be used when setting any variable whose name is
controlled by the user. The names given to `function -a` certainly
qualifies. This wasn't an issue in practice because the only restriction
ENV_USER imposes is also imposed on ENV_LOCAL, but the rules may change
in the future.
This commit is contained in:
Kevin Ballard 2014-10-02 16:03:06 -07:00
parent 3f11d90744
commit 6d7a7b00d7

View file

@ -602,7 +602,7 @@ void parse_util_set_argv(const wchar_t * const *argv, const wcstring_list_t &nam
size_t i; size_t i;
for (i=0, arg=argv; i < named_arguments.size(); i++) for (i=0, arg=argv; i < named_arguments.size(); i++)
{ {
env_set(named_arguments.at(i).c_str(), *arg, ENV_LOCAL); env_set(named_arguments.at(i).c_str(), *arg, ENV_LOCAL | ENV_USER);
if (*arg) if (*arg)
arg++; arg++;