Norihiro Tanaka wrote: > I tryed it on grep-2.20, but didn't pass even EGexecute. So I think > there may be also an another bug in front of there in master.
In current master, grep tests for matching with eolbyte to speed-up to match with binary file, and `execute' is called in this process. I recognize that an input buffer to pass to `execute' must have the eolbyte at the top as sentimental, although I don't think that this bug is caused by that.
From 77f329a8c34cc0acd287d73ba45081608c871f75 Mon Sep 17 00:00:00 2001 From: Norihiro Tanaka <nori...@kcn.ne.jp> Date: Fri, 3 Oct 2014 07:53:06 +0900 Subject: [PATCH] grep: testing matching to with eolbyte, put sentimental in input buffer src/grep.c (grep): Testing matching to with eolbyte, put sentimental in input buffer. --- src/grep.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/grep.c b/src/grep.c index bb5ba1c..5c0c179 100644 --- a/src/grep.c +++ b/src/grep.c @@ -2513,8 +2513,9 @@ main (int argc, char **argv) compile (keys, keycc); free (keys); + char eolbytes[2] = { '\0', '\0' }; size_t match_size; - skip_empty_lines = ((execute (&eolbyte, 1, &match_size, NULL) == 0) + skip_empty_lines = ((execute (&eolbytes[1], 1, &match_size, NULL) == 0) == out_invert); if ((argc - optind > 1 && !no_filenames) || with_filenames) -- 2.1.1