From 9b14b06c3b66f6ea3ebc8aff19a51a83a2f42797 Mon Sep 17 00:00:00 2001 From: Fabio Bas Date: Sat, 8 May 2010 18:07:27 +0000 Subject: fixed infinite loop on corrupted theme installation (could cause a problem with themes containing empty files) fixed theme error reporting git-svn-id: https://svn.kvirc.de/svn/trunk/kvirc@4311 17fca916-40b9-46aa-a4ea-0a15b648b75c --- src/kvilib/file/kvi_packagefile.cpp | 5 +++-- src/modules/theme/themefunctions.cpp | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/kvilib/file/kvi_packagefile.cpp b/src/kvilib/file/kvi_packagefile.cpp index 07972f8af..d5e924433 100644 --- a/src/kvilib/file/kvi_packagefile.cpp +++ b/src/kvilib/file/kvi_packagefile.cpp @@ -846,13 +846,14 @@ bool KviPackageReader::unpackFile(KviFile * pFile,const QString &szUnpackPath) inflateEnd(&zstr); return writeError(); } - } /* else { THIS HAPPENS FOR ZERO SIZE FILES + } else { + //THIS HAPPENS FOR ZERO SIZE FILES debug("hum.... internal, rEWq (ret = %d) (avail_out = %d)",ret,zstr.avail_out); inflateEnd(&zstr); setLastError(__tr2qs("Compression library internal error")); return false; - } */ + } zstr.next_out = obuffer; zstr.avail_out = BUFFER_SIZE; } diff --git a/src/modules/theme/themefunctions.cpp b/src/modules/theme/themefunctions.cpp index cc6963e55..c91760f3a 100644 --- a/src/modules/theme/themefunctions.cpp +++ b/src/modules/theme/themefunctions.cpp @@ -293,7 +293,7 @@ namespace KviThemeFunctions { QString szErr2 = r.lastError(); KviQString::sprintf(szError,__tr2qs_ctx("Failed to unpack the selected file: %Q","theme"),&szErr2); - return true; + return false; } } -- cgit v1.3.1-10-gc9f91