mailing list of musl libc
 help / color / mirror / code / Atom feed
From: Rich Felker <dalias@libc.org>
To: musl@lists.openwall.com
Subject: Re: [PATCH] handle ^ and $ in BRE subexpression start and end as anchors
Date: Thu, 24 Nov 2016 09:46:35 -0500	[thread overview]
Message-ID: <20161124144635.GU1555@brightrain.aerifal.cx> (raw)
In-Reply-To: <20161124004448.GV5749@port70.net>

On Thu, Nov 24, 2016 at 01:44:49AM +0100, Szabolcs Nagy wrote:
> In BRE, ^ is an anchor at the beginning of an expression, optionally
> it may be an anchor at the beginning of a subexpression and must be
> treated as a literal otherwise.
> 
> Previously musl treated ^ in subexpressions as literal, but at least
> glibc and gnu sed treats it as an anchor and that's the more useful
> behaviour: it can always be escaped to get back the literal meaning.
> 
> Same for $ at the end of a subexpression.
> 
> Portable BRE should not rely on this, but there are sed commands in
> build scripts which do.
> 
> This changes the meaning of the BREs:
> 
> 	\(^a\)
> 	\(a\|^b\)
> 	\(a$\)
> 	\(a$\|b\)
> ---
> bit hackish solution, but turns out ctx->re was not used for anything
> else than to detect if ^ was at the start of a full bre, changed that
> to start of a subexpr now.

The renaming of the member from re to start is to prove that there are
no other users that get broken by this? If so, I like that.

Rich


  reply	other threads:[~2016-11-24 14:46 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-11-24  0:44 Szabolcs Nagy
2016-11-24 14:46 ` Rich Felker [this message]
2016-11-24 15:14   ` Szabolcs Nagy

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=20161124144635.GU1555@brightrain.aerifal.cx \
    --to=dalias@libc.org \
    --cc=musl@lists.openwall.com \
    /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/musl/

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).