Bug ID: 2222
Summary: pcre2grep does not support searching for \0 via -f,
even though pcre2 itself supports this
Version: 10.30 (PCRE2)
I've implemented support for git grep -f <pat> where <pat> is a regex
containing \0 (not yet in git upstream).
So I was surprised to see that pcre2grep itself doesn't support this, in fact
it has a bug where it just cuts the pattern off at \0:
$ perl -wE 'say "foo\0bar"' >file; perl -wE 'say "f.*\0[x].*a"' >p;
./pcre2grep -a -f p file; echo $?
Looking at the source the reason is obvious, read_pattern_file() calls strlen()
on the line, and add_pattern() itself takes a char*.
I don't actually need this myself, just thought you'd like to know. Seems like
a nice thing to add since not many grep engines do this correctly, and it would
be relatively easy to add since pcre2_match() supports it, just not the part of
pcre2grep which passes strings around.
You are receiving this mail because:
You are on the CC list for the bug.
This message was posted to the following mailing lists: