From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 26497 invoked by alias); 21 Jun 2017 23:06:23 -0000 Mailing-List: contact zsh-workers-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Workers List List-Post: List-Help: X-Seq: 41341 Received: (qmail 24326 invoked from network); 21 Jun 2017 23:06:23 -0000 X-Qmail-Scanner-Diagnostics: from mx.spodhuis.org by f.primenet.com.au (envelope-from , uid 7791) with qmail-scanner-2.11 (clamdscan: 0.99.2/21882. spamassassin: 3.4.1. Clear:RC:0(94.142.241.89):SA:0(-2.3/5.0):. Processed in 1.758936 secs); 21 Jun 2017 23:06:23 -0000 X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-2.3 required=5.0 tests=RCVD_IN_DNSWL_MED, SPF_HELO_PASS,SPF_PASS,T_DKIM_INVALID,T_RP_MATCHES_RCVD,UNPARSEABLE_RELAY autolearn=unavailable autolearn_force=no version=3.4.1 X-Envelope-From: zsh-workers+phil.pennock@spodhuis.org X-Qmail-Scanner-Mime-Attachments: | X-Qmail-Scanner-Zip-Files: | Received-SPF: pass (ns1.primenet.com.au: SPF record at spodhuis.org designates 94.142.241.89 as permitted sender) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=spodhuis.org; s=d201705; h=In-Reply-To:Content-Type:MIME-Version:References :Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To:Content-Transfer-Encoding :Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=2sINT9xYmgseP6WDDUqGtPs2AcGU88iI5aswT4DOrcE=; b=ziB7fSBEmmx1CnVZTrXhMG/4Zu hXKFg6yGdbx2Q6f+nST9FFKf+DycAmZiP+koqPv+trrrL2fw4y292BkReto7qAESxlfk89NnvmhT2 Xoxha++k+34gO1pSEob7elOSRFVjP0/GNqbHFMctklj8M/AppYLIMdcUpK/6xpXiH+rV2+MTS6by8 GFsU9xYknrVIujNJ8K21BjqcdLQ/; Date: Wed, 21 Jun 2017 18:48:53 -0400 From: Phil Pennock To: Peter Stephenson Cc: zsh-workers@zsh.org Subject: Re: [PATCH] PCRE/NUL: pass NUL in for text, handle NUL out Message-ID: <20170621224853.GA6833@tower.spodhuis.org> References: <20170615204050.GA27003@breadbox.private.spodhuis.org> <20170621095939.1b5fa49d@pwslap01u.europe.root.pri> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20170621095939.1b5fa49d@pwslap01u.europe.root.pri> OpenPGP: url=https://www.security.spodhuis.org/PGP/keys/0x4D1E900E14C1CC04.asc On 2017-06-21 at 09:59 +0100, Peter Stephenson wrote: > On Thu, 15 Jun 2017 16:40:50 -0400 > Phil Pennock wrote: > > +# Embedded NULs allowed in plaintext, but not in RE (although \0 as two-chars allowed) > > + [[ $'a\0bc\0d' =~ '^(a\0.)(.+)$' ]] > > + print "${#MATCH}; ${#match[1]}; ${#match[2]}" > > +>6; 3; 3 > > Not sure what's going on here but there needs to be a status / > description line. How strange, that test passed when I tried it out locally but I would have expected a failure. You're right, sorry about that. Status/description line: 0:ensure ASCII NUL passes in and out of matched plaintext I didn't see a point in trying to figure out text-matches of exact NUL-containing strings in the test-suite, when we could just match the length of the strings. There is logic for passing the full string in now, and for fixing the length of $MATCH, and separately for the lengths of the items in $match; testing both that $match works twice (ie, ovec iteration is not busted) and that `.+` swallows the NUL, not just explicit \0 matching. It seemed a concise way to test all the changes and detect regression. > Was there are a response to Stephane's further suggestion? The <> suggestion was withdrawn within the same paragraph, I agree that the behaviour I implemented is the best choice. ;) As for changing \Q...\E support, that's an entirely different issue, it's a feature request where this patch is a bug-fix. My response is "sounds great, feature patches welcome; any issues with this bug-fix?" -Phil