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

Unified Diff: runtime/bin/platform_impl.dart

Issue 10689065: Deal with special cmd.exe environment variables that have keys that start with an equals sign. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 years, 6 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 | runtime/bin/process_impl.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/bin/platform_impl.dart
diff --git a/runtime/bin/platform_impl.dart b/runtime/bin/platform_impl.dart
index 8999b3e019916d1f7f6aa023c2675e39c5a25d48..d688a464b2736c3673909d32a72644d4daad0f4c 100644
--- a/runtime/bin/platform_impl.dart
+++ b/runtime/bin/platform_impl.dart
@@ -37,7 +37,17 @@ class _Platform {
} else {
var result = new Map();
for (var str in env) {
+ // When running on Windows through cmd.exe there are strange
+ // environment variables that are used to record the current
+ // working directory for each drive and the exit code for the
+ // last command. As an example: '=A:=A:\subdir' records the
+ // current working directory on the 'A' drive. In order to
+ // handle these correctly we search for a second occurrence of
+ // of '=' in the string if the first occurrence is at index 0.
var equalsIndex = str.indexOf('=');
+ if (equalsIndex == 0) {
+ equalsIndex = str.indexOf('=', 1);
+ }
assert(equalsIndex != -1);
result[str.substring(0, equalsIndex)] = str.substring(equalsIndex + 1);
}
« no previous file with comments | « no previous file | runtime/bin/process_impl.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698