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

Unified Diff: runtime/bin/directory_android.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
« no previous file with comments | « no previous file | runtime/bin/directory_linux.cc » ('j') | sdk/lib/io/file_system_entity.dart » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/bin/directory_android.cc
diff --git a/runtime/bin/directory_android.cc b/runtime/bin/directory_android.cc
index 02f841deb3321318fc8ad505a82cb2bec7f94149..e89dd058bea9a20daee461b01b0c1b0d7ec0d264 100644
--- a/runtime/bin/directory_android.cc
+++ b/runtime/bin/directory_android.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_);
« no previous file with comments | « no previous file | runtime/bin/directory_linux.cc » ('j') | sdk/lib/io/file_system_entity.dart » ('J')

Powered by Google App Engine
This is Rietveld 408576698