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

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

Issue 11887021: [NaCl SDK] Add HTTP mount. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: merge Created 7 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: native_client_sdk/src/libraries/nacl_mounts/path.cc
diff --git a/native_client_sdk/src/libraries/nacl_mounts/path.cc b/native_client_sdk/src/libraries/nacl_mounts/path.cc
index 47d4f4586fe4f98365616792cb27f2a5be8761bf..63978b737eae24217ea4c31a114ae5cd98d198e8 100644
--- a/native_client_sdk/src/libraries/nacl_mounts/path.cc
+++ b/native_client_sdk/src/libraries/nacl_mounts/path.cc
@@ -146,14 +146,17 @@ std::string Path::Range(const StringArray_t& paths, size_t start, size_t end) {
if (end > paths.size()) end = paths.size();
+ // If this is an absolute path, paths[0] == "/". In this case, we don't want
+ // to add an additional / separator.
if (start == 0 && end > 0 && paths[0] == "/") {
- if (end == 1) return std::string("/");
+ out_path += "/";
index++;
}
for (; index < end; index++) {
- if (index) out_path += "/";
out_path += paths[index];
+ if (index < end - 1)
+ out_path += "/";
}
return out_path;

Powered by Google App Engine
This is Rietveld 408576698