From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on dcvr.yhbt.net X-Spam-Level: X-Spam-ASN: X-Spam-Status: No, score=-2.0 required=3.0 tests=ALL_TRUSTED,AWL,BAYES_00, RP_MATCHES_RCVD shortcircuit=no autolearn=unavailable version=3.3.2 X-Original-To: meta@public-inbox.org Received: from localhost (dcvr.yhbt.net [127.0.0.1]) by dcvr.yhbt.net (Postfix) with ESMTP id 11A5A44C1A0; Thu, 28 Aug 2014 05:27:34 +0000 (UTC) From: Eric Wong To: meta@public-inbox.org Cc: Eric Wong Subject: [PATCH] view: tighten up regexps used for trimming index Date: Thu, 28 Aug 2014 05:27:32 +0000 Message-Id: <1409203652-29729-1-git-send-email-e@80x24.org> X-Mailer: git-send-email 2.1.0.2.g6fb949a.dirty List-Id: The previous regexp matches were too aggressive w.r.t. scissors. We destroy trailing whitespace anyways, so do not worry about it when cutting signatures and patches off. --- lib/PublicInbox/View.pm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/PublicInbox/View.pm b/lib/PublicInbox/View.pm index 23cb369..d1bb935 100644 --- a/lib/PublicInbox/View.pm +++ b/lib/PublicInbox/View.pm @@ -95,11 +95,11 @@ sub index_entry { $s =~ s/(?:^[^\n]*:\s*\n)?(?:^>[^\n]*\n)+(?:^\s*\n)?//mg; # Drop signatures - $s =~ s/\n*-- \n.*\z//s; + $s =~ s/^-- \n.*\z//ms; # drop the remainder of git patches, they're usually better # to review when the full message is viewed - if ($s =~ s/\n*---\n.*\z//s) { + if ($s =~ s/^---\n.*\z//ms) { $more = "$pfx...\n"; } -- EW