From 9cb54c22725b34ba25fa75a45dea255538584aeb Mon Sep 17 00:00:00 2001 From: kichik Date: Tue, 23 Jan 2007 16:03:10 +0000 Subject: [PATCH] return >0 only when really finished git-svn-id: https://svn.code.sf.net/p/nsis/code/NSIS/trunk@4861 212acab6-be3b-0410-9dea-997c60f758d6 --- Source/cbzip2.h | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/Source/cbzip2.h b/Source/cbzip2.h index 5d5d6189..638b16c9 100644 --- a/Source/cbzip2.h +++ b/Source/cbzip2.h @@ -40,9 +40,13 @@ class CBzip2 : public ICompressor { int Compress(bool finish) { // act like zlib when it comes to stream ending if (last_ret == BZ_STREAM_END && finish) - return BZ_STREAM_END; + return C_FINISHED; last_ret = BZ2_bzCompress(stream, finish?BZ_FINISH:0); - return last_ret; + + if (last_ret < 0) + return last_ret; + + return C_OK; } void SetNextIn(char *in, unsigned int size) {