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

Unified Diff: native_client_sdk/src/libraries/nacl_io/path.cc

Issue 320983002: [NaCl SDK] nacl_io: Allows subtree of html5fs to be mounted. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 6 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: native_client_sdk/src/libraries/nacl_io/path.cc
diff --git a/native_client_sdk/src/libraries/nacl_io/path.cc b/native_client_sdk/src/libraries/nacl_io/path.cc
index 0a64a15ebce411f35d83c3bcc2fe1da7bd5cd72d..ae16b26a445016c7da43ab0a0b489143dc665ab8 100644
--- a/native_client_sdk/src/libraries/nacl_io/path.cc
+++ b/native_client_sdk/src/libraries/nacl_io/path.cc
@@ -44,6 +44,8 @@ bool Path::Top() const {
Path& Path::Append(const std::string& path) {
StringArray_t paths = Split(path);
+ if (paths.size() == 0)
binji 2014/06/09 20:54:29 I prefer paths.empty() for this, but it looks like
Sam Clegg 2014/06/10 17:20:59 Done.
+ return *this;
for (size_t index = 0; index < paths.size(); index++) {
// Skip ROOT
@@ -58,13 +60,16 @@ Path& Path::Append(const std::string& path) {
Path& Path::Prepend(const std::string& path) {
StringArray_t paths = Split(path);
+ if (paths.size() == 0)
+ return *this;
for (size_t index = 0; index < paths_.size(); index++) {
// Skip ROOT
if (index == 0 && paths_[0] == "/")
continue;
- paths.push_back(paths[index]);
+ paths.push_back(paths_[index]);
binji 2014/06/09 20:54:29 why? If needed, be consistent with same in Path::A
Sam Clegg 2014/06/10 17:20:59 This is simply a bug. Append is pushing all the p
binji 2014/06/10 18:00:58 I see.
}
+
paths_ = Normalize(paths);
return *this;
}

Powered by Google App Engine
This is Rietveld 408576698