mirror of
https://github.com/panda3d/panda3d.git
synced 2025-10-03 10:22:45 -04:00
putenv has strange semantics
This commit is contained in:
parent
03eb4ef3d3
commit
b0a9296e39
@ -204,8 +204,12 @@ ns_get_environment_variable(const string &var) const {
|
|||||||
void ExecutionEnvironment::
|
void ExecutionEnvironment::
|
||||||
ns_set_environment_variable(const string &var, const string &value) {
|
ns_set_environment_variable(const string &var, const string &value) {
|
||||||
_variables[var] = value;
|
_variables[var] = value;
|
||||||
string put = var + "=" + value;
|
string putstr = var + "=" + value;
|
||||||
putenv(put.c_str());
|
|
||||||
|
// putenv() requires us to malloc a new C-style string.
|
||||||
|
char *put = (char *)malloc(putstr.length() + 1);
|
||||||
|
strcpy(put, putstr.c_str());
|
||||||
|
putenv(put);
|
||||||
}
|
}
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////
|
||||||
|
Loading…
x
Reference in New Issue
Block a user