From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on dcvr.yhbt.net X-Spam-Level: X-Spam-ASN: X-Spam-Status: No, score=-4.2 required=3.0 tests=ALL_TRUSTED,BAYES_00, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF shortcircuit=no autolearn=ham autolearn_force=no version=3.4.2 Received: from localhost (dcvr.yhbt.net [127.0.0.1]) by dcvr.yhbt.net (Postfix) with ESMTP id 3EED81FAF0 for ; Wed, 23 Nov 2022 04:09:59 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=80x24.org; s=selector1; t=1669176599; bh=aNpWvq33BNBYejCStWb911ECNEZsuelPTBkeWn5z58E=; h=From:To:Subject:Date:In-Reply-To:References:From; b=D+tAdmqnOMFWrJKEww76yqdNYsIpv03kVbuC5b+Zo8su0fZkN9QQp2nKhB3B9+k8n Grvqx+Kcvvo08Rt5343NBrRBPRK/ofSVxX5wmm6Oy/ikF4u86Kxb58L1OmgcwpWF14 TucL/w/MFyVCsEkBG/uiGR9vMapgEBow1yvCZFHI= From: Eric Wong To: meta@public-inbox.org Subject: [PATCH 2/3] config: urlmatch $? does not influence our exits Date: Wed, 23 Nov 2022 04:09:57 +0000 Message-Id: <20221123040958.114960-3-e@80x24.org> In-Reply-To: <20221123040958.114960-1-e@80x24.org> References: <20221123040958.114960-1-e@80x24.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit List-Id: We don't want to leak $? from `git config' failures into lei nor public-inbox-* processes. --- lib/PublicInbox/Config.pm | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/PublicInbox/Config.pm b/lib/PublicInbox/Config.pm index c27928de..6a51226e 100644 --- a/lib/PublicInbox/Config.pm +++ b/lib/PublicInbox/Config.pm @@ -544,11 +544,12 @@ sub urlmatch { my $val = <$fh>; if (close($fh)) { chomp($val); - $val; } else { $urlmatch_broken = 1 if (($? >> 8) != 1); - undef; + undef $val; } + $? = 0; # don't influence lei exit status + $val; } sub json {