setenv is not available in Windows build, replaced with _putenv_s

This commit is contained in:
Eduardo Arias 2024-04-23 12:43:22 -03:00
parent abbd7b2f42
commit 35949179a4

View File

@ -37,7 +37,11 @@ bool SetENV::evaluate(RuleWithActions *rule, Transaction *t) {
auto pair = utils::string::ssplit_pair(colNameExpanded, '=');
ms_dbg_a(t, 8, "Setting environment variable: "
+ pair.first + " to " + pair.second);
#ifndef WIN32
setenv(pair.first.c_str(), pair.second.c_str(), /*overwrite*/ 1);
#else
_putenv_s(pair.first.c_str(), pair.second.c_str());
#endif
return true;
}