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: AS53758 23.128.96.0/24 X-Spam-Status: No, score=-3.9 required=3.0 tests=AWL,BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED,SPF_HELO_PASS,SPF_PASS shortcircuit=no autolearn=ham autolearn_force=no version=3.4.2 Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by dcvr.yhbt.net (Postfix) with ESMTP id 877491F5AE for ; Sat, 8 May 2021 10:52:39 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230420AbhEHKxi (ORCPT ); Sat, 8 May 2021 06:53:38 -0400 Received: from pb-smtp1.pobox.com ([64.147.108.70]:64107 "EHLO pb-smtp1.pobox.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230405AbhEHKxf (ORCPT ); Sat, 8 May 2021 06:53:35 -0400 Received: from pb-smtp1.pobox.com (unknown [127.0.0.1]) by pb-smtp1.pobox.com (Postfix) with ESMTP id A1EECD4925; Sat, 8 May 2021 06:52:33 -0400 (EDT) (envelope-from junio@pobox.com) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed; d=pobox.com; h=from:to:cc :subject:references:date:in-reply-to:message-id:mime-version :content-type:content-transfer-encoding; s=sasl; bh=SrLx22iBzvcg gR870mNLSYZUbuz06DnclpPwAaTjY/0=; b=dQEbZ2ttR1v2Z+QePMCnSBRzJMfP Yrad6R05dVUNaJSTgwDcNjiULEzodrN309D3Rs3PoKlmKsgu7U0QhRdWOXU0XNpH +D89GsbY3t/JvrYx73Vle0B4k+LnMRqxmp/v+HJS9oGU1DLdAW19tkj+M9lCh2gW G0Y7i58nfCIytzM= Received: from pb-smtp1.nyi.icgroup.com (unknown [127.0.0.1]) by pb-smtp1.pobox.com (Postfix) with ESMTP id 99824D4924; Sat, 8 May 2021 06:52:33 -0400 (EDT) (envelope-from junio@pobox.com) Received: from pobox.com (unknown [34.74.119.39]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by pb-smtp1.pobox.com (Postfix) with ESMTPSA id 215D3D4923; Sat, 8 May 2021 06:52:33 -0400 (EDT) (envelope-from junio@pobox.com) From: Junio C Hamano To: =?utf-8?B?xJBvw6BuIFRy4bqnbiBDw7RuZw==?= Danh Cc: git@vger.kernel.org, "brian m. carlson" Subject: Re: [PATCH v3 3/6] mailinfo: warn if CR found in decoded base64/QP email References: <20210421013404.17383-1-congdanhqx@gmail.com> <5aac2ba38e5442019d2816c63d7b65bf2bcf062a.1620311544.git.congdanhqx@gmail.com> Date: Sat, 08 May 2021 19:52:32 +0900 In-Reply-To: <5aac2ba38e5442019d2816c63d7b65bf2bcf062a.1620311544.git.congdanhqx@gmail.com> (=?utf-8?B?IsSQb8OgbiBUcuG6p24gQ8O0bmc=?= Danh"'s message of "Thu, 6 May 2021 22:02:21 +0700") Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.2 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 X-Pobox-Relay-ID: 7E074A7A-AFEB-11EB-96FF-D152C8D8090B-77302942!pb-smtp1.pobox.com Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org =C4=90o=C3=A0n Tr=E1=BA=A7n C=C3=B4ng Danh writes= : > +test_expect_success 'mailinfo warn CR in base64 encoded email' ' > + sed "s/%%/$(printf \\015)/" "$DATA/quoted-cr-msg" >expect-cr-msg && > + sed "s/%%/$(printf \\015)/" "$DATA/quoted-cr-patch" >expect-cr-patch = && As we are not interested in a lone CR in the middle of the line, I wonder if we want to anchor the double per-cent to the end of the line, i.e. "s/%%$/$(printf \\015)/". On the other hand, we may want to make sure that the new option does not disturb CR in the middle of the line, so we may be better off leaving double per-cent unanchored, but allow replacing more than once on a line, i.e. "s/%%/$(printf \\015)/g". If we were to go to the latter route, we'd want to try a file with a CR in the middle of the line (without a CR at the end of any line) and make sure we won't warn or strip.