Date: Tue, 08 Aug 2017 04:11:48 +0000 From: bugzilla-noreply@freebsd.org To: freebsd-bugs@FreeBSD.org Subject: [Bug 166861] bsdgrep(1)/sed(1): bsdgrep -E and sed handle invalid {} constructs strangely Message-ID: <bug-166861-8-5RINC1GzPA@https.bugs.freebsd.org/bugzilla/> In-Reply-To: <bug-166861-8@https.bugs.freebsd.org/bugzilla/> References: <bug-166861-8@https.bugs.freebsd.org/bugzilla/>
next in thread | previous in thread | raw e-mail | index | archive | help
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D166861 --- Comment #4 from commit-hook@freebsd.org --- A commit references this bug: Author: kevans Date: Tue Aug 8 04:10:47 UTC 2017 New revision: 322211 URL: https://svnweb.freebsd.org/changeset/base/322211 Log: regex(3): Handle invalid {} constructs consistently and adjust tests Currently, regex(3) exhibits the following wrong behavior as demonstrated with sed: - echo "a{1,2,3}b" | sed -r "s/{/_/" (1) - echo "a{1,2,3}b" | sed "s/\}/_/" (2) - echo "a{1,2,3}b" | sed -r "s/{}/_/" (3) Cases (1) and (3) should throw errors but they actually succeed, and (2) throws an error when it should match the literal '}'. The correct behavior was decided by comparing to the behavior with the equivalent BRE (1)(3) or ERE (2) and consulting POSIX, along with some reasonable evaluation. Tests were also adjusted/added accordingly. PR: 166861 Reviewed by: emaste, ngie, pfg Approved by: emaste (mentor) MFC after: never Differential Revision: https://reviews.freebsd.org/D10315 Changes: head/contrib/netbsd-tests/lib/libc/regex/data/repet_bounded.in head/contrib/netbsd-tests/lib/libc/regex/data/repet_multi.in head/lib/libc/regex/regcomp.c --=20 You are receiving this mail because: You are the assignee for the bug.=
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?bug-166861-8-5RINC1GzPA>