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

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

Issue 12426013: dart:io | The empty path should return "." for its toNativePath value. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 9 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/path.dart ('k') | tests/standalone/io/path_test.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sdk/lib/io/path_impl.dart
diff --git a/sdk/lib/io/path_impl.dart b/sdk/lib/io/path_impl.dart
index f6ebb7842084cb995f6d41f362c06d613d71b5ee..50e4d38e26b6067dcd9ce26e68f454bc6036d157 100644
--- a/sdk/lib/io/path_impl.dart
+++ b/sdk/lib/io/path_impl.dart
@@ -154,8 +154,9 @@ class _Path implements Path {
return joined.canonicalize();
}
- // Note: The URI RFC names for these operations are normalize, resolve, and
- // relativize.
+ // Note: The URI RFC names for canonicalize, join, and relativeTo
+ // are normalize, resolve, and relativize. But resolve and relativize
+ // drop the last segment of the base path (the filename), on URIs.
Path canonicalize() {
if (isCanonical) return this;
return makeCanonical();
@@ -245,6 +246,7 @@ class _Path implements Path {
}
String toNativePath() {
+ if (isEmpty) return '.';
if (Platform.operatingSystem == 'windows') {
String nativePath = _path;
// Drop '/' before a drive letter.
« no previous file with comments | « sdk/lib/io/path.dart ('k') | tests/standalone/io/path_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698