From 2bb4a60f05fe9f031c19cb6d59b049614f3c410d Mon Sep 17 00:00:00 2001 From: "nweiz@google.com" <nweiz@google.com> Date: Thu, 19 Jun 2014 20:47:41 +0000 Subject: [PATCH] Return consistent path separators from listDir in pub. R=rnystrom@google.com BUG=19554 Review URL: https://codereview.chromium.org//349433003 git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge@37514 260f80e4-7a28-3924-810f-c04153c831b5 --- lib/src/io.dart | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lib/src/io.dart b/lib/src/io.dart index 4d4ddd5a..8aae3e21 100644 --- a/lib/src/io.dart +++ b/lib/src/io.dart @@ -303,7 +303,10 @@ List<String> listDir(String dir, {bool recursive: false, if (pathInDir.contains("/.")) return false; if (Platform.operatingSystem != "windows") return true; return !pathInDir.contains("\\."); - }).map((entity) => entity.path).toList(); + }).map((entity) { + if (Platform.operatingSystem != "windows") return entity.path; + return entity.path.replaceAll("/", "\\"); + }).toList(); } /// Returns whether [dir] exists on the file system. -- GitLab