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

Unified Diff: utils/pub/io.dart

Issue 11528020: Fix issue 7215 by relativising a path before checking its components. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 years 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 | « utils/pub/command_lish.dart ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: utils/pub/io.dart
diff --git a/utils/pub/io.dart b/utils/pub/io.dart
index 63879b3128a151d25f45a3a8d35b4794f243d878..0ecc7b2498942789d4dbbabfa8db420dec1a3bdb 100644
--- a/utils/pub/io.dart
+++ b/utils/pub/io.dart
@@ -74,7 +74,7 @@ List<String> splitPath(path) => _sanitizePath(path).split('/');
/// performs a path comparison; it doesn't look at the actual filesystem.
bool isBeneath(entry, dir) {
var relative = relativeTo(entry, dir);
- return !path.isAbsolute(relative) && !relative.startsWith('..');
+ return !path.isAbsolute(relative) && splitPath(relative)[0] != '..';
}
// TODO(nweiz): move this into path.dart.
« no previous file with comments | « utils/pub/command_lish.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698