[gnome-epub-thumbnailer] epub: Print warning for fatal decompression errors



commit 3a0896bec0230783807ae1689791acbad6afde6a
Author: Bastien Nocera <hadess hadess net>
Date:   Sun Sep 1 17:25:20 2013 +0200

    epub: Print warning for fatal decompression errors
    
    This makes it easier to debug decompression problems.

 gnome-epub-thumbnailer.c |   10 +++++++++-
 1 files changed, 9 insertions(+), 1 deletions(-)
---
diff --git a/gnome-epub-thumbnailer.c b/gnome-epub-thumbnailer.c
index 921fb15..e2a3615 100644
--- a/gnome-epub-thumbnailer.c
+++ b/gnome-epub-thumbnailer.c
@@ -68,9 +68,17 @@ file_get_zipped_contents (const char   *filename,
                return NULL;
        }
 
-       while (archive_read_next_header(a, &entry) == ARCHIVE_OK) {
+       while (1) {
                const char *name;
 
+               r = archive_read_next_header(a, &entry);
+
+               if (r != ARCHIVE_OK) {
+                       if (r != ARCHIVE_EOF && r == ARCHIVE_FATAL)
+                               g_warning ("Fatal error handling archive: %s", archive_error_string (a));
+                       break;
+               }
+
                name = archive_entry_pathname (entry);
                if (func (name, user_data) == 0) {
                        size_t size = archive_entry_size (entry);


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]