From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 11110 invoked by alias); 24 Jun 2019 07:41:18 -0000 Mailing-List: contact bzip2-devel-help@sourceware.org; run by ezmlm Precedence: bulk List-Post: List-Help: List-Subscribe: List-Id: Sender: bzip2-devel-owner@sourceware.org Received: (qmail 11096 invoked by uid 89); 24 Jun 2019 07:41:18 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Checked: by ClamAV 0.100.3 on sourceware.org X-Virus-Found: No X-Spam-SWARE-Status: No, score=-19.2 required=5.0 tests=AWL,BAYES_00,GIT_PATCH_0,GIT_PATCH_1,GIT_PATCH_2,GIT_PATCH_3,SPF_PASS autolearn=ham version=3.3.1 spammy=noisy, recover X-Spam-Status: No, score=-19.2 required=5.0 tests=AWL,BAYES_00,GIT_PATCH_0,GIT_PATCH_1,GIT_PATCH_2,GIT_PATCH_3,SPF_PASS autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on sourceware.org X-Spam-Level: X-HELO: gnu.wildebeest.org From: Mark Wielaard To: bzip2-devel@sourceware.org Cc: Anibal Monsalve Salazar , =?UTF-8?q?Santiago=20Ruano=20Rinc=C3=B3n?= , Anthony Fok , Mark Wielaard Subject: [PATCH] bzip2: Fix return value when combining --test,-t and -q. Date: Tue, 01 Jan 2019 00:00:00 -0000 Message-Id: <1561362056-4393-1-git-send-email-mark@klomp.org> X-Mailer: git-send-email 1.8.3.1 X-Spam-Flag: NO X-SW-Source: 2019-q2/txt/msg00004.txt.bz2 Hi, bzip2 lost its domain and got a new home at https://sourceware.org/bzip2/ It also didn't see a release for a very long time. Causing various patches used by distros to not have been integrated upstream. We are trying to collect them all and do a new release. The following patch comes from Debian. Please let us know if we missed some others. Thanks, Mark When passing -q to get quiet output --test would not display an error message, but would also suppress the exit 2 code to indicate the file was corrupt. Only suppress the error message with -q, not the exit value. This patch comes from Debian. "bunzip2 -qt returns 0 for corrupt archives" https://bugs.debian.org/279025 --- bzip2.c | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/bzip2.c b/bzip2.c index 854a2bb..63649f6 100644 --- a/bzip2.c +++ b/bzip2.c @@ -2003,12 +2003,14 @@ IntNative main ( IntNative argc, Char *argv[] ) testf ( aa->name ); } } - if (testFailsExist && noisy) { - fprintf ( stderr, - "\n" - "You can use the `bzip2recover' program to attempt to recover\n" - "data from undamaged sections of corrupted files.\n\n" - ); + if (testFailsExist) { + if (noisy) { + fprintf ( stderr, + "\n" + "You can use the `bzip2recover' program to attempt to recover\n" + "data from undamaged sections of corrupted files.\n\n" + ); + } setExit(2); exit(exitValue); } -- 1.8.3.1