bug-gnulib
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


From: Paul Eggert
Subject: "grep '\]'" warnings suggest a Gnulib DFA patch
Date: Fri, 3 Jun 2022 18:54:34 -0700
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.10.0

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.savannah.gnu.org/cgit/gnulib.git/commit/?id=762bd0aa660b0c1c02597e0d2e5c5fbf9bab1b91

Even though POSIX says the interpretation of \] is undefined (which means the Gnulib patch is helpful), it's unlikely that any POSIX-conforming regular expression matcher would do anything other than treat \] like plain ]. And this suggests that GNU grep's warning about \] is perhaps more trouble than it's worth.

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.

Attachment: 0001-dfa-do-not-warn-about.patch
Description: Text Data


reply via email to

[Prev in Thread] Current Thread [Next in Thread]