diff options
author | Andrei Karas <akaras@inbox.ru> | 2017-05-16 22:41:56 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2017-05-16 22:41:56 +0300 |
commit | 8e0bd85107f57e900658129f9cfbded0866f0883 (patch) | |
tree | 05dab2c86bcf6d079c69ecb40dea258a6572fbbe /src/fs/virtfs/fszip.cpp | |
parent | ba71181d5e6fd35083a9e7a86c8e1a9592581398 (diff) | |
download | mv-8e0bd85107f57e900658129f9cfbded0866f0883.tar.gz mv-8e0bd85107f57e900658129f9cfbded0866f0883.tar.bz2 mv-8e0bd85107f57e900658129f9cfbded0866f0883.tar.xz mv-8e0bd85107f57e900658129f9cfbded0866f0883.zip |
Improve a bit subDir empty check in virtfs.
Diffstat (limited to 'src/fs/virtfs/fszip.cpp')
-rw-r--r-- | src/fs/virtfs/fszip.cpp | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/src/fs/virtfs/fszip.cpp b/src/fs/virtfs/fszip.cpp index 068b7ee45..d70df7749 100644 --- a/src/fs/virtfs/fszip.cpp +++ b/src/fs/virtfs/fszip.cpp @@ -95,7 +95,7 @@ namespace FsZip { ZipEntry *const zipEntry = static_cast<ZipEntry*>(entry); std::string subDir = zipEntry->subDir; - if (subDir != dirSeparator) + if (!subDir.empty()) { filename = pathJoin(subDir, filename); dirName = pathJoin(subDir, dirName); @@ -129,7 +129,7 @@ namespace FsZip { ZipEntry *const zipEntry = static_cast<ZipEntry*>(entry); std::string subDir = zipEntry->subDir; - if (subDir != dirSeparator) + if (!subDir.empty()) { filename = pathJoin(subDir, filename); dirName = pathJoin(subDir, dirName); @@ -157,7 +157,7 @@ namespace FsZip { ZipEntry *const zipEntry = static_cast<ZipEntry*>(entry); const std::string subDir = zipEntry->subDir; - if (subDir != dirSeparator) + if (!subDir.empty()) dirName = pathJoin(subDir, dirName); if (dirName == dirSeparator) { @@ -220,7 +220,7 @@ namespace FsZip { ZipEntry *const zipEntry = static_cast<ZipEntry*>(entry); const std::string subDir = zipEntry->subDir; - if (subDir != dirSeparator) + if (!subDir.empty()) dirName = pathJoin(subDir, dirName); if (dirName == dirSeparator) { @@ -319,7 +319,7 @@ namespace FsZip ZipEntry *const zipEntry = static_cast<ZipEntry*>(entry); const std::string subDir = zipEntry->subDir; std::string dirNameFull; - if (subDir != dirSeparator) + if (!subDir.empty()) dirNameFull = pathJoin(subDir, dirName); else dirNameFull = dirName; @@ -419,7 +419,7 @@ namespace FsZip { ZipEntry *const zipEntry = static_cast<ZipEntry*>(entry); const std::string subDir = zipEntry->subDir; - if (subDir != dirSeparator) + if (!subDir.empty()) dirName = pathJoin(subDir, dirName); if (dirName == dirSeparator) { @@ -517,7 +517,7 @@ namespace FsZip { ZipEntry *const zipEntry = static_cast<ZipEntry*>(entry); std::string subDir = zipEntry->subDir; - if (subDir != dirSeparator) + if (!subDir.empty()) dirName = pathJoin(subDir, dirName); FOR_EACH (std::vector<std::string>::const_iterator, it2, @@ -542,7 +542,7 @@ namespace FsZip { ZipEntry *const zipEntry = static_cast<ZipEntry*>(entry); std::string subDir = zipEntry->subDir; - if (subDir != dirSeparator) + if (!subDir.empty()) filename = pathJoin(subDir, filename); FOR_EACH (std::vector<ZipLocalHeader*>::const_iterator, it2, @@ -675,7 +675,7 @@ namespace FsZip { ZipEntry *const zipEntry = static_cast<ZipEntry*>(entry); const std::string subDir = zipEntry->subDir; - if (subDir != dirSeparator) + if (!subDir.empty()) filename = pathJoin(subDir, filename); FOR_EACH (std::vector<ZipLocalHeader*>::const_iterator, it2, |