From 6d7a7b00d77098c93aa2b6c0deba4c18029b5a32 Mon Sep 17 00:00:00 2001 From: Kevin Ballard Date: Thu, 2 Oct 2014 16:03:06 -0700 Subject: [PATCH] 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. --- parse_util.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/parse_util.cpp b/parse_util.cpp index a941113f6..9822cff53 100644 --- a/parse_util.cpp +++ b/parse_util.cpp @@ -602,7 +602,7 @@ void parse_util_set_argv(const wchar_t * const *argv, const wcstring_list_t &nam size_t 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) arg++;