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

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

Issue 131373002: Fix listing of '' and '/'. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 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 | « sdk/lib/io/directory_impl.dart ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sdk/lib/io/file_system_entity.dart
diff --git a/sdk/lib/io/file_system_entity.dart b/sdk/lib/io/file_system_entity.dart
index af28044defe6b3c6dc0e4dec6cbfe7993c268550..d35efc5c1b264841e8cee149c91138de5d6de104 100644
--- a/sdk/lib/io/file_system_entity.dart
+++ b/sdk/lib/io/file_system_entity.dart
@@ -622,6 +622,22 @@ abstract class FileSystemEntity {
}
return path;
}
+
+ static String _ensureTrailingPathSeparators(String path) {
+ // Don't handle argument errors here.
+ if (path is! String) return path;
+ if (path.isEmpty) path = '.';
+ if (Platform.operatingSystem == 'windows') {
+ while (!path.endsWith(Platform.pathSeparator) && !path.endsWith('/')) {
+ path = "$path${Platform.pathSeparator}";
+ }
+ } else {
+ while (!path.endsWith(Platform.pathSeparator)) {
+ path = "$path${Platform.pathSeparator}";
+ }
+ }
+ return path;
+ }
}
« no previous file with comments | « sdk/lib/io/directory_impl.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698