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

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

Issue 738863003: Fix glob list failure on Windows. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 1 month 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 | pkg/pkg.status » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/glob/lib/src/list_tree.dart
diff --git a/pkg/glob/lib/src/list_tree.dart b/pkg/glob/lib/src/list_tree.dart
index bf6f7a4a73d023c3aa45064f9b22b34336a00e0d..3667d63c1abbd2a1a9492af9601203717604f736 100644
--- a/pkg/glob/lib/src/list_tree.dart
+++ b/pkg/glob/lib/src/list_tree.dart
@@ -13,11 +13,13 @@ import 'ast.dart';
import 'stream_pool.dart';
import 'utils.dart';
-/// The errno for a file or directory not existing.
-///
-/// This is consistent across platforms.
+/// The errno for a file or directory not existing on Mac and Linux.
const _ENOENT = 2;
+/// Another errno we see on Windows when trying to list a non-existent
+/// directory.
+const _ENOENT_WIN = 3;
+
/// A structure built from a glob that efficiently lists filesystem entities
/// that match that glob.
///
@@ -331,7 +333,8 @@ class _ListTreeNode {
// glob "foo/bar/*/baz" should fail if "foo/bar" doesn't exist but
// succeed if "foo/bar/qux/baz" doesn't exist.
return error is FileSystemException &&
- error.osError.errorCode == _ENOENT;
+ (error.osError.errorCode == _ENOENT ||
+ error.osError.errorCode == _ENOENT_WIN);
});
resultPool.add(stream);
});
@@ -382,7 +385,8 @@ class _ListTreeNode {
// that we only ignore warnings below wild cards. For example, the
// glob "foo/bar/*/baz" should fail if "foo/bar" doesn't exist but
// succeed if "foo/bar/qux/baz" doesn't exist.
- if (error.osError.errorCode == _ENOENT) {
+ if (error.osError.errorCode == _ENOENT ||
+ error.osError.errorCode == _ENOENT_WIN) {
return const [];
} else {
rethrow;
« no previous file with comments | « no previous file | pkg/pkg.status » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698