summaryrefslogtreecommitdiffstatshomepage
path: root/src
diff options
context:
space:
mode:
author Vas Crabb <vas@vastheman.com>2026-05-21 01:31:48 +1000
committer Vas Crabb <vas@vastheman.com>2026-05-21 01:31:48 +1000
commit8031d62240d06a69bd1684e909643fef4a736755 (patch)
tree20ea3a3b826068fb905dd623d08347ab4981abeb /src
parentcc1e3ee97a63e778947c30db038fafe3efe2f2c2 (diff)
util/zippath.cpp: Adjusted error handling.
Fixes some cases of failing to open files in archives.
Diffstat (limited to 'src')
-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);
}
}