Re: "grep '\]'" warnings suggest a Gnulib DFA patch

2022-06-04 Thread Paul Eggert
On 6/3/22 20:08, Bruno Haible wrote: But when I think about the thousands of people who use regular expressions out there. How would they remember that in parentheses both should be backslash-escaped in EREs \( \) It's even weirder, in that POSIX says unmatched ')' is treated like '\)'

Re: "grep '\]'" warnings suggest a Gnulib DFA patch

2022-06-03 Thread Jim Meyering
On Fri, Jun 3, 2022 at 8:09 PM Bruno Haible wrote: > Paul Eggert asked: > > So, what do you think of the idea of not warning for this particular > > stray backslash? Proposed Gnulib patch attached, with the idea of > > propagating this into GNU grep before its upcoming release. I haven't > > insta

Re: "grep '\]'" warnings suggest a Gnulib DFA patch

2022-06-03 Thread Bruno Haible
Paul Eggert asked: > So, what do you think of the idea of not warning for this particular > stray backslash? Proposed Gnulib patch attached, with the idea of > propagating this into GNU grep before its upcoming release. I haven't > installed this. Warning about undefined behaviour is good. But

Re: "grep '\]'" warnings suggest a Gnulib DFA patch

2022-06-03 Thread Bruno Haible
Paul Eggert wrote: > While testing, I discovered that master-branch grep's bootstrap script > contained a regular expression with '\]' that master-branch grep now > warns about. I fixed this portability bug in 'bootstrap' ... Similarly, '\}' is undefined in EREs [1]. We probably also have a numb

Re: "grep '\]'" warnings suggest a Gnulib DFA patch

2022-06-03 Thread Jeffrey Walton
On Fri, Jun 3, 2022 at 9:54 PM Paul Eggert wrote: > > While testing, I discovered that master-branch grep's bootstrap script > contained a regular expression with '\]' that master-branch grep now > warns about. I fixed this portability bug in 'bootstrap' by installing > the following patch into Gn

"grep '\]'" warnings suggest a Gnulib DFA patch

2022-06-03 Thread Paul Eggert
While testing, I discovered that master-branch grep's bootstrap script contained a regular expression with '\]' that master-branch grep now warns about. I fixed this portability bug in 'bootstrap' by installing the following patch into Gnulib and propagating this into grep master: https://git.