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.cpp29
1 files changed, 15 insertions, 14 deletions
diff --git a/src/lib/util/zippath.cpp b/src/lib/util/zippath.cpp
index ef4e4334db5..c498dcbbf52 100644
--- a/src/lib/util/zippath.cpp
+++ b/src/lib/util/zippath.cpp
@@ -713,30 +713,29 @@ std::error_condition zippath_fopen(std::string_view filename, uint32_t openflags
filerr = std::errc::permission_denied;
else
filerr = std::errc::no_such_file_or_directory;
- goto done;
}
else if (osd::directory::entry::entry_type::DIR == entry_type)
{
filerr = std::errc::is_a_directory;
- goto done;
}
else if (openflags & OPEN_FLAG_WRITE)
{
filerr = std::errc::permission_denied;
- goto done;
}
-
- // attempt to read the file
- filerr = create_core_file_from_zip(*zip, file);
- if (filerr)
- goto done;
-
- // update subpath, if appropriate
- if (subpath.empty())
- subpath.assign(zip->current_name());
+ else
+ {
+ // attempt to read the file
+ filerr = create_core_file_from_zip(*zip, file);
+ if (!filerr)
+ {
+ // update subpath, if appropriate
+ if (subpath.empty())
+ subpath.assign(zip->current_name());
+ }
+ }
// we're done
- goto done;
+ break;
}
}
@@ -748,6 +747,9 @@ std::error_condition zippath_fopen(std::string_view filename, uint32_t openflags
// if we errored, then go up a directory
if (filerr)
{
+ if (std::errc::no_such_file_or_directory != filerr)
+ break;
+
// go up a directory
auto temp = zippath_parent(mainpath);
@@ -773,7 +775,6 @@ std::error_condition zippath_fopen(std::string_view filename, uint32_t openflags
}
}
-done:
// store the revised path
revised_path.clear();
if (!filerr)