zsh-workers
 help / color / mirror / code / Atom feed
From: Phil Pennock <zsh-workers+phil.pennock@spodhuis.org>
To: Peter Stephenson <p.stephenson@samsung.com>
Cc: zsh-workers@zsh.org
Subject: Re: [PATCH] PCRE/NUL: pass NUL in for text, handle NUL out
Date: Wed, 21 Jun 2017 18:48:53 -0400	[thread overview]
Message-ID: <20170621224853.GA6833@tower.spodhuis.org> (raw)
In-Reply-To: <20170621095939.1b5fa49d@pwslap01u.europe.root.pri>

On 2017-06-21 at 09:59 +0100, Peter Stephenson wrote:
> On Thu, 15 Jun 2017 16:40:50 -0400
> Phil Pennock <zsh-workers+phil.pennock@spodhuis.org> 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 <<replace NUL with "\0">> 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


      reply	other threads:[~2017-06-21 23:06 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <CGME20170615204203epcas5p4b0a2bcbcfe0843d979c653df6b8352db@epcas5p4.samsung.com>
2017-06-15 20:40 ` Phil Pennock
2017-06-16  6:41   ` Stephane Chazelas
2017-06-17  3:10     ` Bart Schaefer
2017-06-17  6:31       ` Stephane Chazelas
2017-06-20 20:07   ` Phil Pennock
2017-06-21  8:59   ` Peter Stephenson
2017-06-21 22:48     ` Phil Pennock [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20170621224853.GA6833@tower.spodhuis.org \
    --to=zsh-workers+phil.pennock@spodhuis.org \
    --cc=p.stephenson@samsung.com \
    --cc=zsh-workers@zsh.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).