Jim Meyering e137695202 sed: do not reject "\c[" in a regular expression
As a GNU extension, "\c[" in a regexp matches the ESC character
(i.e., control-[). Yet 's/\c[//' was rejected because "[" was treated
as the beginning of a bracket expression.
* sed/compile.c (match_slash): When matching "slash"es, treat \c as
an escape sequence, so that s/\c[// no longer fails because it
misinterprets [ as a bracket-group start.
* testsuite/misc.pl (bug79519_1,2,3,fail): Add tests.
* NEWS (Bug fixes): Mention it.
Reported by Michael Ludwig in https://bugs.gnu.org/79519.
2025-10-01 03:20:22 -07:00
..