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

Unified Diff: runtime/bin/directory_macos.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_macos.cc
diff --git a/runtime/bin/directory_macos.cc b/runtime/bin/directory_macos.cc
index feb9a9ca8dec1a7045eaac9bef0a6badd322c3e2..94b495d7e466df7af32c5c68e715d7f5fcd57f03 100644
--- a/runtime/bin/directory_macos.cc
+++ b/runtime/bin/directory_macos.cc
@@ -79,11 +79,6 @@ ListType DirectoryListingEntry::Next(DirectoryListing* listing) {
}
if (lister_ == 0) {
- if (!listing->path_buffer().Add(File::PathSeparator())) {
- done_ = true;
- return kListError;
- }
- path_length_ = listing->path_buffer().length();
do {
lister_ = reinterpret_cast<intptr_t>(
opendir(listing->path_buffer().AsString()));
@@ -93,6 +88,12 @@ ListType DirectoryListingEntry::Next(DirectoryListing* listing) {
done_ = true;
return kListError;
}
+ if (parent_ != NULL) {
+ if (!listing->path_buffer().Add(File::PathSeparator())) {
+ return kListError;
+ }
+ }
+ path_length_ = listing->path_buffer().length();
}
// Reset.
listing->path_buffer().Reset(path_length_);

Powered by Google App Engine
This is Rietveld 408576698