We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents f8aa1f8 + 319bfa9 commit 82799d7Copy full SHA for 82799d7
platform/windows/os_windows.cpp
@@ -1614,16 +1614,7 @@ String OS_Windows::get_executable_path() const {
1614
}
1615
1616
bool OS_Windows::has_environment(const String &p_var) const {
1617
-#ifdef MINGW_ENABLED
1618
- return _wgetenv((LPCWSTR)(p_var.utf16().get_data())) != nullptr;
1619
-#else
1620
- WCHAR *env;
1621
- size_t len;
1622
- _wdupenv_s(&env, &len, (LPCWSTR)(p_var.utf16().get_data()));
1623
- const bool has_env = env != nullptr;
1624
- free(env);
1625
- return has_env;
1626
-#endif
+ return GetEnvironmentVariableW((LPCWSTR)(p_var.utf16().get_data()), nullptr, 0) > 0;
1627
1628
1629
String OS_Windows::get_environment(const String &p_var) const {
0 commit comments