Skip to content

Commit

Permalink
Fix searching file in image list
Browse files Browse the repository at this point in the history
Use absolute path for searching.

Signed-off-by: Artem Senichev <[email protected]>
  • Loading branch information
artemsen committed Jan 26, 2025
1 parent 94acab8 commit b50ed8a
Show file tree
Hide file tree
Showing 4 changed files with 259 additions and 210 deletions.
7 changes: 6 additions & 1 deletion src/application.c
Original file line number Diff line number Diff line change
Expand Up @@ -381,14 +381,19 @@ bool app_init(const struct config* cfg, const char** sources, size_t num)
sources = &stdin_name;
}
}
if (image_list_init(cfg, sources, num) == 0) {
image_list_init(cfg);
for (size_t i = 0; i < num; ++i) {
image_list_add(sources[i]);
}
if (image_list_size() == 0) {
if (force_load) {
fprintf(stderr, "%s: Unable to open\n", sources[0]);
} else {
fprintf(stderr, "No image files found to view, exit\n");
}
return false;
}
image_list_reorder();

// load the first image
first_image = load_first_file(image_list_find(sources[0]), force_load);
Expand Down
Loading

0 comments on commit b50ed8a

Please sign in to comment.