]> git.ipfire.org Git - thirdparty/glibc.git/commit
posix: Sync gnulib regex implementation
authorAdhemerval Zanella <adhemerval.zanella@linaro.org>
Wed, 20 Dec 2017 11:47:44 +0000 (09:47 -0200)
committerFangrui Song <i@maskray.me>
Sat, 28 Aug 2021 00:26:07 +0000 (17:26 -0700)
commit6951b6ac39514059e7d3b16764296c19b33fc5d7
tree8b22b1a1ae4b5b0b2e9f66644f531eedca2439aa
parent2887b50077caf7479fabe49195c4419963643823
posix: Sync gnulib regex implementation

This patch syncs the regex implementation with gnulib (commit 0ee5212).
Only two changes in GLIBC regex testing are required:

  1. posix/bug-regex28.c: as previously discussed [1] the change of
     expected results on the pattern should be safe.

  2. posix/PCRE.tests: the ERE (a)|\1 is malformed (in the sense that
     the \1 doesn't mean anything) and although current GLIBC accepts
     it has undefined behavior.  This patch removes the specific test.

This sync contains some patches from thread 'Regex: Make libc regex
more usable outside GLIBC.' [2] which have been pushed upstream in
gnulib.  This patches also fixes some regex issues (BZ #23233,
BZ #21163, BZ #18986, BZ #13762) and I did not add testcases for
both #23233 and #13762 because I couldn't think a simple way to
trigger the expected failure path to trigger them.

Checked on x86_64-linux-gnu and i686-linux-gnu.

[BZ #23233]
[BZ #21163]
[BZ #18986]
[BZ #13762]
* posix/Makefile (tests): Add bug-regex37 and bug-regex38.
* posix/PCRE.tests: Remove invalid test.
* posix/bug-regex28.c: Fix expected values for used syntax.
* posix/bug-regex37.c: New file.
* posix/bug-regex38.c: Likewise.
* posix/regcomp.c: Sync with gnulib.
* posix/regex.c: Likewise.
* posix/regex.h: Likewise.
* posix/regex_internal.c: Likewise.
* posix/regex_internal.h: Likewise.
* posix/regexec.c: Likewise.

[1] https://sourceware.org/ml/libc-alpha/2017-12/msg00807.html
[2] https://sourceware.org/ml/libc-alpha/2017-12/msg00237.html
posix/Makefile
posix/PCRE.tests
posix/bug-regex28.c
posix/bug-regex37.c [new file with mode: 0644]
posix/bug-regex38.c [new file with mode: 0644]
posix/regcomp.c
posix/regex.c
posix/regex.h
posix/regex_internal.c
posix/regex_internal.h
posix/regexec.c