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

Unified Diff: runtime/bin/directory_win.cc

Issue 131373002: Fix listing of '' and '/'. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 11 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
Index: runtime/bin/directory_win.cc
diff --git a/runtime/bin/directory_win.cc b/runtime/bin/directory_win.cc
index 3733a71384e5d734f7d4b52d1694aba85875238f..54c99c1f4d1a4feddd896823a359010064f68c87 100644
--- a/runtime/bin/directory_win.cc
+++ b/runtime/bin/directory_win.cc
@@ -170,7 +170,7 @@ ListType DirectoryListingEntry::Next(DirectoryListing* listing) {
WIN32_FIND_DATAW find_file_data;
if (lister_ == 0) {
- if (!listing->path_buffer().AddW(L"\\*")) {
+ if (!listing->path_buffer().AddW(L"*")) {
done_ = true;
return kListError;
}
@@ -187,6 +187,12 @@ ListType DirectoryListingEntry::Next(DirectoryListing* listing) {
lister_ = reinterpret_cast<intptr_t>(find_handle);
+ if (parent_ != NULL) {
+ if (!listing->path_buffer().AddW(L"\\")) {
+ return kListError;
+ }
+ }
+
listing->path_buffer().Reset(path_length_);
return HandleFindFile(listing, this, find_file_data);

Powered by Google App Engine
This is Rietveld 408576698