From: Carlos O'Donell <carlos@redhat.com>
To: наб <nabijaczleweli@nabijaczleweli.xyz>,
"Adhemerval Zanella Netto" <adhemerval.zanella@linaro.org>
Cc: libc-alpha@sourceware.org
Subject: Re: [PATCH v7 1/3] posix: regcomp(): clear RE_DOT_NOT_NULL
Date: Mon, 12 Jun 2023 09:11:03 -0400 [thread overview]
Message-ID: <c17460b2-5aa4-f978-2b71-c577c0b60e8e@redhat.com> (raw)
In-Reply-To: <aeffa34acdcb8da840639ba67cf8984d2bd343d6.1686530834.git.nabijaczleweli@nabijaczleweli.xyz>
On 6/11/23 20:47, наб wrote:
> The POSIX API always stops at first NUL so there's no change for that.
>
> The BSD REG_STARTEND API, with its explicit range, can include NULs
> within that range, and those NULs are matched with . and [^].
>
> Heretofor, for a string of "a\0c", glibc would match "[^q]c", but not
> ".c". This is both inconsistent and nonconformant to BSD REG_STARTEND.
>
> With this patch, they're identical like you'd expect, and the
> tst-reg-startend.c: ..c: a^@c: no match$
> failure is removed.
>
> Another approach would be to remove it from _RE_SYNTAX_POSIX_COMMON,
> but it's unclear to me what the custody chain is like for that and what
> other regex APIs glibc offers that could be affected by this.
>
> Signed-off-by: Ahelenia Ziemiańska <nabijaczleweli@nabijaczleweli.xyz>
These changes are being made to sources shared between gnulib and glibc.
As the files are listed in SHARED-SOURCES we cannot easily accept changes to them
since they should be shared with gnulib.
Would you be willing to disclaim these changes or assign copyright?
> ---
> No changes (rebased cleanly); full resend.
>
> posix/regcomp.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/posix/regcomp.c b/posix/regcomp.c
> index 12650714c0..a928ef6c2d 100644
> --- a/posix/regcomp.c
> +++ b/posix/regcomp.c
> @@ -462,7 +462,7 @@ regcomp (regex_t *__restrict preg, const char *__restrict pattern, int cflags)
> {
> reg_errcode_t ret;
> reg_syntax_t syntax = ((cflags & REG_EXTENDED) ? RE_SYNTAX_POSIX_EXTENDED
> - : RE_SYNTAX_POSIX_BASIC);
> + : RE_SYNTAX_POSIX_BASIC) & ~RE_DOT_NOT_NULL;
>
> preg->buffer = NULL;
> preg->allocated = 0;
--
Cheers,
Carlos.
next prev parent reply other threads:[~2023-06-12 13:11 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-05-07 22:56 [PATCH v4 1/3] posix: add (failing) test for REG_STARTEND наб
2023-05-07 22:56 ` [PATCH v4 2/3] posix: regcomp(): clear RE_DOT_NOT_NULL наб
2023-05-07 22:56 ` [PATCH v4 3/3] posix: regexec(): fix REG_STARTEND, pmatch->rm_so != 0 w/^ anchor наб
2023-05-29 18:11 ` Adhemerval Zanella Netto
2023-05-29 13:22 ` [PATCH v5 1/3] posix: add (failing) test for REG_STARTEND наб
2023-05-29 13:22 ` [PATCH v5 2/3] posix: regcomp(): clear RE_DOT_NOT_NULL наб
2023-05-29 13:22 ` [PATCH v5 3/3] posix: regexec(): fix REG_STARTEND, pmatch->rm_so != 0 w/^ anchor наб
2023-05-29 17:37 ` [PATCH v4 1/3] posix: add (failing) test for REG_STARTEND Adhemerval Zanella Netto
2023-05-29 20:10 ` наб
2023-05-29 20:23 ` Adhemerval Zanella Netto
2023-06-12 0:47 ` [PATCH v7 1/3] posix: regcomp(): clear RE_DOT_NOT_NULL наб
2023-06-12 13:11 ` Carlos O'Donell [this message]
2023-06-12 0:47 ` [PATCH v7 2/3] posix: regexec(): fix REG_STARTEND, pmatch->rm_so != 0 w/^ anchor наб
2023-06-12 13:11 ` Carlos O'Donell
2023-06-12 14:03 ` наб
2023-06-12 0:47 ` [PATCH v7 3/3] posix: add test for REG_STARTEND наб
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=c17460b2-5aa4-f978-2b71-c577c0b60e8e@redhat.com \
--to=carlos@redhat.com \
--cc=adhemerval.zanella@linaro.org \
--cc=libc-alpha@sourceware.org \
--cc=nabijaczleweli@nabijaczleweli.xyz \
/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.
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 read-only IMAP folder(s) and NNTP newsgroup(s).