Index: native_client_sdk/src/libraries/nacl_io/html5fs/html5_fs.cc |
diff --git a/native_client_sdk/src/libraries/nacl_io/html5fs/html5_fs.cc b/native_client_sdk/src/libraries/nacl_io/html5fs/html5_fs.cc |
index bb6b9cc87ed4f451f860377ab4d25aa1816555b6..5acc69c6ed67fc88d6580c8581c0e07e350c0f52 100644 |
--- a/native_client_sdk/src/libraries/nacl_io/html5fs/html5_fs.cc |
+++ b/native_client_sdk/src/libraries/nacl_io/html5fs/html5_fs.cc |
@@ -45,9 +45,8 @@ ino_t Html5Fs::HashPath(const Path& path) { |
// Apply a running DJB2a to each part of the path |
for (size_t segment = 0; segment < path.Size(); segment++) { |
- const char *ptr = path.Part(segment).c_str(); |
- size_t len = path.Part(segment).length(); |
- hash = HashPathSegment(hash, ptr, len); |
+ std::string part = path.Part(segment); |
+ hash = HashPathSegment(hash, part.c_str(), part.length()); |
} |
return hash; |
} |
@@ -71,8 +70,9 @@ Error Html5Fs::OpenWithMode(const Path& path, int open_flags, mode_t mode, |
if (error) |
return error; |
+ std::string full_path(GetFullPath(path).Join()); |
PP_Resource fileref = file_ref_iface_->Create( |
- filesystem_resource_, GetFullPath(path).Join().c_str()); |
+ filesystem_resource_, full_path.c_str()); |
if (!fileref) |
return ENOENT; |
@@ -114,10 +114,10 @@ Error Html5Fs::Mkdir(const Path& path, int permissions) { |
if (path.IsRoot()) |
return EEXIST; |
+ std::string full_path(GetFullPath(path).Join()); |
ScopedResource fileref_resource( |
ppapi(), |
- file_ref_iface_->Create(filesystem_resource_, |
- GetFullPath(path).Join().c_str())); |
+ file_ref_iface_->Create(filesystem_resource_, full_path.c_str())); |
if (!fileref_resource.pp_resource()) |
return ENOENT; |
@@ -142,10 +142,10 @@ Error Html5Fs::RemoveInternal(const Path& path, int remove_type) { |
if (error) |
return error; |
+ std::string full_path(GetFullPath(path).Join()); |
ScopedResource fileref_resource( |
ppapi(), |
- file_ref_iface_->Create(filesystem_resource_, |
- GetFullPath(path).Join().c_str())); |
+ file_ref_iface_->Create(filesystem_resource_, full_path.c_str())); |
if (!fileref_resource.pp_resource()) |
return ENOENT; |