summaryrefslogtreecommitdiffstats
path: root/native_client_sdk/src/libraries/nacl_mounts/path.cc
diff options
context:
space:
mode:
authorbinji@chromium.org <binji@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-01-19 04:05:22 +0000
committerbinji@chromium.org <binji@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-01-19 04:05:22 +0000
commitb3c1be96db0c7b8b0dfc52a8556e6459feefe62b (patch)
tree2710f0ff31eee0e08f842c60d53476326f15f903 /native_client_sdk/src/libraries/nacl_mounts/path.cc
parentb796a770148eabf41696278fb339437ae96112a0 (diff)
downloadchromium_src-b3c1be96db0c7b8b0dfc52a8556e6459feefe62b.zip
chromium_src-b3c1be96db0c7b8b0dfc52a8556e6459feefe62b.tar.gz
chromium_src-b3c1be96db0c7b8b0dfc52a8556e6459feefe62b.tar.bz2
[NaCl SDK] Add HTTP mount.
BUG=156781 R=noelallen@chromium.org NOTRY=true Review URL: https://chromiumcodereview.appspot.com/11887021 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@177823 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'native_client_sdk/src/libraries/nacl_mounts/path.cc')
-rw-r--r--native_client_sdk/src/libraries/nacl_mounts/path.cc7
1 files changed, 5 insertions, 2 deletions
diff --git a/native_client_sdk/src/libraries/nacl_mounts/path.cc b/native_client_sdk/src/libraries/nacl_mounts/path.cc
index 47d4f45..63978b7 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;