diff options
author | Ricardo Pérez <ricpelo@gmail.com> | 2015-05-05 22:27:05 +0200 |
---|---|---|
committer | Ricardo Pérez <ricpelo@gmail.com> | 2015-05-05 22:27:05 +0200 |
commit | 7bb53831d8aec2507f6341bd00deae29fde8e2c2 (patch) | |
tree | bf6ce42c3dfee2707f7b8adff072297603b59a23 /platform/windows/os_windows.cpp | |
parent | af068439829a3fec3a76c4c5d4dd2dba71ab6c5f (diff) | |
parent | bc3c14a76b988a50e65328a932316c2e630a7ae6 (diff) |
Merge pull request #6 from okamstudio/master
Sync
Diffstat (limited to 'platform/windows/os_windows.cpp')
-rw-r--r-- | platform/windows/os_windows.cpp | 11 |
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) { |