Subject: bug#43527: [PATCH] grep: avoid unneeded compilation of regex

From: Jim Meyering <[email-masked]>
Date: Sat, 26 Sep 2020 13:48:16 -0700

On Tue, Sep 22, 2020 at 8:04 PM Norihiro Tanaka <[email-masked]> wrote:
> On Tue, 22 Sep 2020 16:25:06 -0700
> Jim Meyering <[email-masked]> wrote:
>
> > Oh! Good timing. I was about to make a new snapshot.
> > Do you happen to have a test case handy that demonstrates the failure?
>
> I added test case to previous patch.
>
> By the way, I found the following bug in making the test case, and it's
> still left.
>
> $ env LC_ALL=tr_TR.utf8 grep -Fio i in
> Aborted (core dumped)
>
> (gdb) bt
> #0  0x0000003b8d032495 in raise () from /lib64/libc.so.6
> #1  0x0000003b8d033c75 in abort () from /lib64/libc.so.6
> #2  0x000000000040cdde in kwsinit (mb_trans=true) at searchutils.c:64
> #3  0x0000000000409624 in Fcompile (pattern=0x23c1240 "i\n", size=1, ignored=0, exact=true) at kwsearch.c:56
> #4  0x0000000000409378 in main (argc=4, argv=0x7ffe76048388) at grep.c:2977

Using the latest sources plus that patch, I ran all of the tests with
an assertion that kwsearch->exact == !!start_ptr before each use of
that new member, and the assertion never failed.
As far as I can see, this patch is not necessary (also, I could not
reproduce your abort), so I'm closing this issue. Please reopen if you
can demonstrate its utility.