mirror of
https://github.com/panda3d/panda3d.git
synced 2025-09-27 15:25:54 -04:00
dtoolutil: fix ExecutionEnvironment::has_environment_variable() for shadowed var
Fixes MAIN_DIR being set more than once (which seems to avoid a compiler bug in an opt4 build).
This commit is contained in:
parent
8f9ca34eec
commit
30bca7a119
@ -217,9 +217,11 @@ get_cwd() {
|
||||
*/
|
||||
bool ExecutionEnvironment::
|
||||
ns_has_environment_variable(const string &var) const {
|
||||
#ifdef PREREAD_ENVIRONMENT
|
||||
return _variables.count(var) != 0;
|
||||
#else
|
||||
if (_variables.count(var) != 0) {
|
||||
return true;
|
||||
}
|
||||
|
||||
#ifndef PREREAD_ENVIRONMENT
|
||||
return getenv(var.c_str()) != nullptr;
|
||||
#endif
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user