# HG changeset patch # User Chris Cannam # Date 1528385998 -3600 # Node ID b60cb1637634e5a3609226b05fc1ba766138f645 # Parent 5afbac960a3009b6c2688233f2b5d7d09a55c7cf Setenv is nicer here diff -r 5afbac960a30 -r b60cb1637634 system/System.cpp --- a/system/System.cpp Thu Jun 07 16:18:42 2018 +0100 +++ b/system/System.cpp Thu Jun 07 16:39:58 2018 +0100 @@ -394,9 +394,9 @@ bool putEnvUtf8(std::string variable, std::string value) { +#ifdef _WIN32 std::string entry = variable + "=" + value; -#ifdef _WIN32 int wentlen = MultiByteToWideChar(CP_UTF8, 0, entry.c_str(), int(entry.length()), 0, 0); @@ -424,8 +424,7 @@ #else - int rv = putenv(entry.c_str()); - + int rv = setenv(variable.c_str(), value.c_str(), 1); if (rv != 0) { SVCERR << "WARNING: Failed to set environment entry" << endl; return false;