diff options
author | Andrei Karas <akaras@inbox.ru> | 2017-04-02 06:23:19 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2017-04-03 18:44:58 +0300 |
commit | 49631972db5b965413d4bbe36983a8d5bd203183 (patch) | |
tree | cb31545521cb4b33e65f8e94e7f2d5cd33e9e7a1 /src/fs | |
parent | be7786e70668c014b19263895a6c8f507ed8161d (diff) | |
download | plus-49631972db5b965413d4bbe36983a8d5bd203183.tar.gz plus-49631972db5b965413d4bbe36983a8d5bd203183.tar.bz2 plus-49631972db5b965413d4bbe36983a8d5bd203183.tar.xz plus-49631972db5b965413d4bbe36983a8d5bd203183.zip |
Use pathJoin for concatinate some paths.
Diffstat (limited to 'src/fs')
-rw-r--r-- | src/fs/virtfs/virtfstools.cpp | 16 |
1 files changed, 6 insertions, 10 deletions
diff --git a/src/fs/virtfs/virtfstools.cpp b/src/fs/virtfs/virtfstools.cpp index 8bcc0d065..ca65bbdf2 100644 --- a/src/fs/virtfs/virtfstools.cpp +++ b/src/fs/virtfs/virtfstools.cpp @@ -51,8 +51,7 @@ namespace VirtFs { const std::string file = path + str; const std::string realPath = VirtFs::getRealDir(file); - VirtFs::mountZip(std::string(realPath).append( - dirSeparator).append(file), append); + VirtFs::mountZip(pathJoin(realPath, file), append); } } VirtFs::freeList(list); @@ -71,10 +70,7 @@ namespace VirtFs { const std::string file = path + str; const std::string realPath = VirtFs::getRealDir(file); - VirtFs::unmountZip(std::string( - realPath).append( - dirSeparator).append( - file)); + VirtFs::unmountZip(pathJoin(realPath, file)); } } VirtFs::freeList(list); @@ -114,7 +110,7 @@ namespace VirtFs VirtList *const fonts = VirtFs::enumerateFiles(path); FOR_EACH (StringVectCIter, i, fonts->names) { - if (!VirtFs::isDirectory(path + dirSeparator + *i)) + if (!VirtFs::isDirectory(pathJoin(path, *i))) list.push_back(*i); } VirtFs::freeList(fonts); @@ -125,7 +121,7 @@ namespace VirtFs VirtList *const fonts = VirtFs::enumerateFiles(path); FOR_EACH (StringVectCIter, i, fonts->names) { - if (VirtFs::isDirectory(path + dirSeparator + *i)) + if (VirtFs::isDirectory(pathJoin(path, *i))) list.push_back(*i); } VirtFs::freeList(fonts); @@ -140,7 +136,7 @@ namespace VirtFs // if the file is not in the search path, then its empty if (!tmp.empty()) { - path = std::string(tmp).append(dirSeparator).append(file); + path = pathJoin(tmp, file); #if defined __native_client__ std::string dataZip = "/http/data.zip/"; if (path.substr(0, dataZip.length()) == dataZip) @@ -150,7 +146,7 @@ namespace VirtFs else { // if not found in search path return the default path - path = getPackageDir().append(dirSeparator).append(file); + path = pathJoin(getPackageDir(), file); } return path; |