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

Unified Diff: pkg/glob/lib/src/utils.dart

Issue 607963002: Fix glob list on Windows. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 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 | « pkg/glob/lib/src/list_tree.dart ('k') | pkg/glob/test/list_test.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/glob/lib/src/utils.dart
diff --git a/pkg/glob/lib/src/utils.dart b/pkg/glob/lib/src/utils.dart
index 35526c0860556ce2b7340d29ab9d74ae675c5428..f17f2ed8cc64a5216c72d8ce41b1989678fb96f1 100644
--- a/pkg/glob/lib/src/utils.dart
+++ b/pkg/glob/lib/src/utils.dart
@@ -68,3 +68,11 @@ String separatorToForwardSlash(String path) {
if (p.style != p.Style.windows) return path;
return path.replaceAll('\\', '/');
}
+
+/// Returns [path] which follows [context] converted to the POSIX format that
+/// globs match against.
+String toPosixPath(p.Context context, String path) {
+ if (context.style == p.Style.windows) return path.replaceAll('\\', '/');
+ if (context.style == p.Style.url) return Uri.decodeFull(path);
+ return path;
+}
« no previous file with comments | « pkg/glob/lib/src/list_tree.dart ('k') | pkg/glob/test/list_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698