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

Unified Diff: sdk/lib/core/uri.dart

Issue 23522030: Don't use Uri's isAbsolute to detect if the path segment is absolute, in toFilePath. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 3 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 | tests/co19/co19-co19.status » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sdk/lib/core/uri.dart
diff --git a/sdk/lib/core/uri.dart b/sdk/lib/core/uri.dart
index 503509946adfbaf2773a5809d73c837396c68882..f80a30018e9e14680c63fd30b9aebbe8f952d9b3 100644
--- a/sdk/lib/core/uri.dart
+++ b/sdk/lib/core/uri.dart
@@ -971,7 +971,7 @@ class Uri {
}
_checkNonWindowsPathReservedCharacters(pathSegments, false);
var result = new StringBuffer();
- if (isAbsolute) result.write("/");
+ if (_isPathAbsolute) result.write("/");
result.writeAll(pathSegments, "/");
return result.toString();
}
@@ -989,7 +989,7 @@ class Uri {
_checkWindowsPathReservedCharacters(segments, false);
}
var result = new StringBuffer();
- if (isAbsolute && !hasDriveLetter) result.write("\\");
+ if (_isPathAbsolute && !hasDriveLetter) result.write("\\");
if (host != "") {
result.write("\\");
result.write(host);
@@ -1000,6 +1000,11 @@ class Uri {
return result.toString();
}
+ bool get _isPathAbsolute {
+ if (path == null || path.isEmpty) return false;
+ return path.startsWith('/');
+ }
+
void _writeAuthority(StringSink ss) {
_addIfNonEmpty(ss, userInfo, userInfo, "@");
ss.write(_host == null ? "null" : _host);
« no previous file with comments | « no previous file | tests/co19/co19-co19.status » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698