summaryrefslogtreecommitdiffstatshomepage
path: root/src/lib/util/zippath.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib/util/zippath.cpp')
-rw-r--r--src/lib/util/zippath.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/lib/util/zippath.cpp b/src/lib/util/zippath.cpp
index c498dcbbf52..81f7ab48330 100644
--- a/src/lib/util/zippath.cpp
+++ b/src/lib/util/zippath.cpp
@@ -741,13 +741,13 @@ std::error_condition zippath_fopen(std::string_view filename, uint32_t openflags
if (subpath.empty())
filerr = util::core_file::open(filename, openflags, file);
- else
+ else if (!filerr)
filerr = std::errc::no_such_file_or_directory;
// if we errored, then go up a directory
if (filerr)
{
- if (std::errc::no_such_file_or_directory != filerr)
+ if ((std::errc::no_such_file_or_directory != filerr) && (std::errc::not_a_directory != filerr))
break;
// go up a directory
@@ -771,7 +771,7 @@ std::error_condition zippath_fopen(std::string_view filename, uint32_t openflags
while (len > 0 && is_zip_file_separator(temp[len - 1]))
len--;
temp = temp.substr(0, len);
- mainpath.assign(temp);
+ mainpath = std::move(temp);
}
}