Using setenv instead of putenv on SetEnv action

This commit is contained in:
Felipe Zimmerle
2020-12-09 18:39:24 -03:00
committed by Felipe Zimmerle
parent ba0007a474
commit 3a55909eae
3 changed files with 40 additions and 8 deletions

View File

@@ -35,10 +35,10 @@ namespace actions {
bool SetENV::execute(Transaction *t) const noexcept {
std::string colNameExpanded(getEvaluatedRunTimeString(t));
auto pair = utils::string::ssplit_pair(colNameExpanded, '=');
ms_dbg_a(t, 8, "Setting envoriment variable: "
+ colNameExpanded + ".");
putenv(strdup(colNameExpanded.c_str()));
+ pair.first + " to " + pair.second);
setenv(pair.first.c_str(), pair.second.c_str(), /*overwrite*/ 1);
return true;
}