On Wed, Mar 23, 2022 at 11:37 AM René Scharfe <l.s.r@xxxxxx> wrote: > > Am 23.03.22 um 02:09 schrieb Carlo Marcelo Arenas Belón: > > On Tue, Mar 22, 2022 at 09:26:10PM +0100, René Scharfe wrote: > >> Interesting. So you say bug 2642 [3] requires the flag PCRE2_CASELESS > >> (i.e. --ignore-case) to be triggered. (That's probably documented in > >> Bugzilla, but I'm not authorized to access it.) > > > > AFAIK the contents of the bugzilla are no longer accessible to anyone > > (lost in the migration of PCRE2 to github), but the use of > > PCRE2_CASELESS introduced in 95ca1f987e (grep/pcre2: better support > > invalid UTF-8 haystacks, 2021-01-24) might have been a mistake all > > along. > > Ah, OK. It happens though that the original bug2642 did require PCRE2_CASELESS and was fixed instead by PhilipHazel/pcre2@f8cbb1f5[7], so you were correct when suggesting that the lazy coding of the condition was fixing more than one bug and therefore it will be better left unchanged IMHO (except maybe from an improved comment) > The patch below adds a test that fails even with a PCRE2 configured with > --disable-git. Current main passes this test even with PCRE2 versions > 10.34 and 10.35. > > "PCRE2_MATCH_INVALID_UTF && (options & PCRE2_UTF)" can be simplified to > "options & PCRE2_MATCH_INVALID_UTF". indeed, but will also need the PCRE2_CASELESS part that was required from the original bug thanks for adding a test for the infinite loop one, will definitely help future readers. Carlo