Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(52)

Unified Diff: runtime/bin/platform_win.cc

Issue 831213002: Omit variables beginning with "=" from Windows environment. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 5 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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);
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698