Skip to content

Commit

Permalink
fix filename() ? 🤔
Browse files Browse the repository at this point in the history
  • Loading branch information
xurei committed Oct 8, 2023
1 parent 426c839 commit b6f547d
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/util/file_util.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,8 @@ char *load_file_zipped_or_local(std::string path) {
}

int zip_err_code;
const char *zip_entry = fs_path.filename().string().c_str();
info("zip_entry: %s", zip_entry);
std::string zip_entry = fs_path.filename().string();
info("zip_entry: %s", zip_entry.c_str());
struct zip_stat file_stat;
zip_t *zip_archive = zip_open(zip_path.c_str(), ZIP_RDONLY, &zip_err_code);

Expand All @@ -47,15 +47,15 @@ char *load_file_zipped_or_local(std::string path) {
return NULL;
}

if (zip_stat(zip_archive, zip_entry, 0, &file_stat) != 0) {
do_log(LOG_ERROR, "Cannot open shadertastic file in archive '%s': unable to stat entry file %s : %s\n", zip_path.c_str(), zip_entry, zip_error_strerror(zip_get_error(zip_archive)));
if (zip_stat(zip_archive, zip_entry.c_str(), 0, &file_stat) != 0) {
do_log(LOG_ERROR, "Cannot open shadertastic file in archive '%s': unable to stat entry file %s : %s\n", zip_path.c_str(), zip_entry.c_str(), zip_error_strerror(zip_get_error(zip_archive)));
return NULL;
}

zip_file_t *zipped_file = zip_fopen(zip_archive, zip_entry, 0);
zip_file_t *zipped_file = zip_fopen(zip_archive, zip_entry.c_str(), 0);

if (zipped_file == NULL) {
do_log(LOG_ERROR, "Cannot open shadertastic file in archive '%s': unable to open entry file %s\n", zip_path.c_str(), zip_entry);
do_log(LOG_ERROR, "Cannot open shadertastic file in archive '%s': unable to open entry file %s\n", zip_path.c_str(), zip_entry.c_str());
return NULL;
}

Expand Down

0 comments on commit b6f547d

Please sign in to comment.