summaryrefslogtreecommitdiffstats
path: root/platform
diff options
context:
space:
mode:
authorJuan Linietsky <reduzio@gmail.com>2015-05-04 18:32:18 -0300
committerJuan Linietsky <reduzio@gmail.com>2015-05-04 18:32:18 -0300
commita6e6c5b8787d8218762f8a52ed99ef4248248c94 (patch)
treec0e7a2a23798212760aeed3f7372693d4bac6348 /platform
parent2d396fb71070f282b6858cb77efac1c948b6b4a9 (diff)
parent2a02d3f96f8fa3ed844a9abf58c0bf4d8023ebcc (diff)
downloadredot-engine-a6e6c5b8787d8218762f8a52ed99ef4248248c94.tar.gz
Merge branch 'master' of https://github.com/okamstudio/godot
Diffstat (limited to 'platform')
-rw-r--r--platform/windows/os_windows.cpp11
1 files changed, 6 insertions, 5 deletions
diff --git a/platform/windows/os_windows.cpp b/platform/windows/os_windows.cpp
index 93275b3d54..1350719778 100644
--- a/platform/windows/os_windows.cpp
+++ b/platform/windows/os_windows.cpp
@@ -2117,12 +2117,13 @@ bool OS_Windows::has_environment(const String& p_var) const {
String OS_Windows::get_environment(const String& p_var) const {
- char* val = getenv(p_var.utf8().get_data());
- if (val)
- return val;
-
+ wchar_t wval[0x7Fff]; // MSDN says 32767 char is the maximum
+ int wlen = GetEnvironmentVariableW(p_var.c_str(),wval,0x7Fff);
+ if ( wlen > 0 ) {
+ return wval;
+ }
return "";
-};
+}
String OS_Windows::get_stdin_string(bool p_block) {