forked from teamnwah/openmw-tes3coop
Fix setting of longer environmental variables on Windows
This commit is contained in:
parent
804259b2c9
commit
35de28e239
1 changed files with 2 additions and 6 deletions
|
@ -14,12 +14,8 @@ using namespace std;
|
||||||
#ifdef _WIN32
|
#ifdef _WIN32
|
||||||
int setenv(const char *name, const char *value, int overwrite)
|
int setenv(const char *name, const char *value, int overwrite)
|
||||||
{
|
{
|
||||||
std::unique_ptr<char> tmp(new char[strlen(name) + strlen(value) + 1]);
|
printf("%s: %s\n", name, value);
|
||||||
sprintf(tmp.get(), "%s=%s", name, value);
|
return _putenv_s(name, value);
|
||||||
|
|
||||||
printf("%s\n",tmp.get());
|
|
||||||
|
|
||||||
return putenv((const char*)tmp.get());
|
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue