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

Unified Diff: sdk/lib/io/platform_impl.dart

Issue 835863004: Ignore all environment variables with name starting with '=' (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: sdk/lib/io/platform_impl.dart
diff --git a/sdk/lib/io/platform_impl.dart b/sdk/lib/io/platform_impl.dart
index 0cffec6a532bd98f77549122771e11297bec48ff..e0d485bf3d47b70591daa6ccb8f8bec1496ec2d0 100644
--- a/sdk/lib/io/platform_impl.dart
+++ b/sdk/lib/io/platform_impl.dart
@@ -62,14 +62,14 @@ class _Platform {
// 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.
+ // current working directory on the 'A' drive. These environment
+ // variables are ignored.
+ //
+ // On Mac OS an entry of just '=' has been seen.
Lasse Reichstein Nielsen 2015/01/05 11:45:43 Add: Entries with no '=' should not happen. If it
Søren Gjesse 2015/01/05 12:32:14 Done.
var equalsIndex = str.indexOf('=');
- if (equalsIndex == 0) {
- equalsIndex = str.indexOf('=', 1);
+ if (equalsIndex == 0 || equalsIndex == -1) {
Lasse Reichstein Nielsen 2015/01/05 11:45:43 equalsIndex <= 0 ? But switch the condition and a
Søren Gjesse 2015/01/05 12:32:14 Done.
+ continue;
}
- assert(equalsIndex != -1);
result[str.substring(0, equalsIndex)] =
str.substring(equalsIndex + 1);
}
« 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