From: Pawel Andruszkiewicz Date: Wed, 3 Jun 2015 10:16:07 +0000 (+0200) Subject: [Common] Fixed VirtualFs::GetRealPath() method. X-Git-Tag: submit/tizen_mobile/20150609.113445^2~1^2~1 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=dca0a1b9fd8f4ca938d1eabbcdfc5720a9489e63;p=platform%2Fcore%2Fapi%2Fwebapi-plugins.git [Common] Fixed VirtualFs::GetRealPath() method. [Verification] Code compiles. Change-Id: Ia3ae086ea58fdc178edf468c42ffea6cb6d2d073 Signed-off-by: Pawel Andruszkiewicz --- diff --git a/src/common/virtual_fs.cc b/src/common/virtual_fs.cc index 1cd236a8..97983fcc 100755 --- a/src/common/virtual_fs.cc +++ b/src/common/virtual_fs.cc @@ -268,6 +268,7 @@ optional VirtualFs::GetApplicationDirectory() const { std::string VirtualFs::GetRealPath(const std::string& path_or_uri) const { LoggerD("Enter"); + SLoggerD("Input: [%s]", path_or_uri.c_str()); std::string realpath; std::size_t pos = path_or_uri.find(kFileUriPrefix); if (pos != std::string::npos) { @@ -280,11 +281,12 @@ std::string VirtualFs::GetRealPath(const std::string& path_or_uri) const { const std::string prefix = realpath.substr(0, pos); const auto it = g_virtual_roots.find(prefix); if (it != g_virtual_roots.end()) { - realpath.replace(0, it->second.path_.size(), it->second.path_); + realpath.replace(0, prefix.size(), it->second.path_); } else { LoggerE("Unknown virtual root"); } } + SLoggerD("Exit: [%s]", realpath.c_str()); return realpath; }