Jaroslav Škarvada wrote: > URL: > <http://savannah.gnu.org/bugs/?29614> > > Summary: --mmap option is not ignored > Project: grep > > This bug originates from: > https://bugzilla.redhat.com/show_bug.cgi?id=583895 > > $ grep --help | grep mmap > --mmap ignored for backwards compatibility > > $grep --mmap MeaningOfLife /dev/urandom > Usage: grep [OPTION]... PATTERN [FILE]... > Try `grep --help' for more information.
:-) Thanks for the report. [I'll update the log to mention the BZ, too] Here's a patch: >From 87ada69b10de3fb552474b23ffd0efda144ae978 Mon Sep 17 00:00:00 2001 From: Jim Meyering <[email protected]> Date: Tue, 20 Apr 2010 12:34:26 +0200 Subject: [PATCH] grep's --mmap option was not being ignored MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * src/main.c (main): Ignore MMAP_OPTION. * NEWS (Bug fixes): Mention it. * tests/Makefile.am (TESTS): Add it. * tests/ignore-mmap: New file. Reported by Jaroslav Škarvada in <http://savannah.gnu.org/bugs/?29614> --- NEWS | 3 +++ src/main.c | 3 +++ tests/Makefile.am | 1 + 3 files changed, 7 insertions(+), 0 deletions(-) diff --git a/NEWS b/NEWS index 1bf9011..8ef193b 100644 --- a/NEWS +++ b/NEWS @@ -4,6 +4,9 @@ GNU grep NEWS -*- outline -*- ** Bug fixes + now, grep really does ignore the --mmap option + [bug introduced in 2.6] + Searching with grep -Fw for an empty string would not match an empty line. [bug present since "the beginning"] diff --git a/src/main.c b/src/main.c index aa3819c..6b7e4b4 100644 --- a/src/main.c +++ b/src/main.c @@ -2057,6 +2057,9 @@ main (int argc, char **argv) EXCLUDE_WILDCARDS | EXCLUDE_INCLUDE); break; + case MMAP_OPTION: /* ignored */ + break; + case GROUP_SEPARATOR_OPTION: group_separator = optarg; break; diff --git a/tests/Makefile.am b/tests/Makefile.am index 86a35c1..b81e9ee 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -47,6 +47,7 @@ TESTS = \ fmbtest \ foad1 \ help-version \ + ignore-mmap \ include-exclude \ khadafy.sh \ max-count-vs-context \ -- 1.7.1.rc1.248.gcefbb
