From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on dcvr.yhbt.net X-Spam-Level: X-Spam-ASN: X-Spam-Status: No, score=-4.0 required=3.0 tests=ALL_TRUSTED,BAYES_00 shortcircuit=no autolearn=ham autolearn_force=no version=3.4.0 Received: from localhost (dcvr.yhbt.net [127.0.0.1]) by dcvr.yhbt.net (Postfix) with ESMTP id 9BB2520179; Sun, 26 Jun 2016 23:42:20 +0000 (UTC) Date: Sun, 26 Jun 2016 23:42:20 +0000 From: Eric Wong To: meta@public-inbox.org Subject: [PATCH 3/1] inbox: avoid trying s// on undef Message-ID: <20160626234220.GA13030@dcvr.yhbt.net> References: <20160626233131.7531-1-e@80x24.org> <20160626233907.GA5728@dcvr.yhbt.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20160626233907.GA5728@dcvr.yhbt.net> List-Id: Oops, I guess I'm trigger-happy today. Fixes: 31a6ff1221fe ("inbox: ensure we do not show leading "From " lines") --- lib/PublicInbox/Inbox.pm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/PublicInbox/Inbox.pm b/lib/PublicInbox/Inbox.pm index 87c2c9f..ada713c 100644 --- a/lib/PublicInbox/Inbox.pm +++ b/lib/PublicInbox/Inbox.pm @@ -100,7 +100,7 @@ sub msg_by_path ($$;$) { my ($self, $path, $ref) = @_; # TODO: allow other refs: my $str = git($self)->cat_file('HEAD:'.$path, $ref); - $$str =~ s/\A[\r\n]*From [^\r\n]*\r?\n//s; + $$str =~ s/\A[\r\n]*From [^\r\n]*\r?\n//s if $str; $str; }