citrun

watch C/C++ source code execute
Log | Files | Refs | LICENSE

commit b3cc8bd16dfd19383a6c31757c0c6ecbae0d2446
parent e0208b5db820f2593f59fe5f8538f7f3f7583a4d
Author: Kyle Milz <kyle@0x30.net>
Date:   Mon,  2 Jan 2017 01:28:59 -0700

src: restore lost unix setenv

Diffstat:
Msrc/inst_frontend.cc | 11+++++++----
1 file changed, 7 insertions(+), 4 deletions(-)

diff --git a/src/inst_frontend.cc b/src/inst_frontend.cc @@ -137,10 +137,13 @@ InstFrontend::clean_PATH() exit(1); } - if (_putenv_s("Path", new_path.str().c_str())) { - m_log << "setenv" << std::endl; - exit(1); - } +#ifdef _WIN32 + if (SetEnvironmentVariable("Path", new_path.str().c_str()) == 0) + Err(1); +#else // _WIN32 + if (setenv("PATH", new_path.str().c_str(), 1)) + err(1, "setenv"); +#endif // _WIN32 }