From 653e62cf843fa04c9bc358130daab0285eb21fe6 Mon Sep 17 00:00:00 2001 From: Sebastian Rasmussen Date: Tue, 28 Jun 2016 13:15:43 +0200 Subject: cbz: Use case insensitive comparison for extension. --- source/cbz/mucbz.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'source') diff --git a/source/cbz/mucbz.c b/source/cbz/mucbz.c index 91918f57..74b96268 100644 --- a/source/cbz/mucbz.c +++ b/source/cbz/mucbz.c @@ -7,7 +7,6 @@ typedef struct cbz_page_s cbz_page; static const char *cbz_ext_list[] = { ".jpg", ".jpeg", ".png", ".gif", ".bmp", ".tif", ".tiff", - ".JPG", ".JPEG", ".PNG", ".GIF", ".BMP", ".TIF", ".TIFF", NULL }; @@ -89,7 +88,8 @@ cbz_create_page_list(fz_context *ctx, cbz_document *doc) for (k = 0; cbz_ext_list[k]; k++) { const char *name = fz_list_archive_entry(ctx, zip, i); - if (strstr(name, cbz_ext_list[k])) + const char *ext = name ? strrchr(name, '.') : NULL; + if (ext && !fz_strcasecmp(ext, cbz_ext_list[k])) { doc->page[doc->page_count++] = name; break; -- cgit v1.2.3