Index: runtime/bin/platform_win.cc |
diff --git a/runtime/bin/platform_win.cc b/runtime/bin/platform_win.cc |
index 0d3cb11c2f15306bf94199380fa46d69e509e80d..8c94225091d253d60c276140c21f9d61334d38a7 100644 |
--- a/runtime/bin/platform_win.cc |
+++ b/runtime/bin/platform_win.cc |
@@ -44,14 +44,14 @@ char** Platform::Environment(intptr_t* count) { |
wchar_t* tmp = strings; |
intptr_t i = 0; |
while (*tmp != '\0') { |
Søren Gjesse
2015/01/05 12:39:30
Please add a comment why these are skipped.
Lasse Reichstein Nielsen
2015/01/05 13:09:24
Done.
|
- i++; |
+ if (*tmp != '=') i++; |
tmp += (wcslen(tmp) + 1); |
} |
*count = i; |
char** result = new char*[i]; |
tmp = strings; |
- for (intptr_t current = 0; current < i; current++) { |
- result[current] = StringUtils::WideToUtf8(tmp); |
+ for (intptr_t current = 0; current < i;) { |
+ if (*tmp != '=') result[current++] = StringUtils::WideToUtf8(tmp); |
tmp += (wcslen(tmp) + 1); |
} |
FreeEnvironmentStringsW(strings); |