Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 20 Sep 2021 08:27:21 +0000
From:      bugzilla-noreply@freebsd.org
To:        bugs@FreeBSD.org
Subject:   [Bug 258616] fgrep fails to find string that is present
Message-ID:  <bug-258616-227-9lkk4aPs4k@https.bugs.freebsd.org/bugzilla/>
In-Reply-To: <bug-258616-227@https.bugs.freebsd.org/bugzilla/>
References:  <bug-258616-227@https.bugs.freebsd.org/bugzilla/>

next in thread | previous in thread | raw e-mail | index | archive | help
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D258616

--- Comment #3 from Darren Tucker <dtucker@dtucker.net> ---
oh, it looks like /usr/bin/grep is gnu/usr.bin/grep and not usr.bin/grep:

$ grep --version
grep (GNU grep) 2.5.1-FreeBSD [...]

building gnu/usr.bin/grep does indeed reproduce the problem.

I reproduced the problem with stock GNU grep v2.5.1 and found that it was f=
ixed
between 2.18 and 2.19 in this upstream commit:

commit 757381e58d669729510a89c323d4698f9a81f6c0
Author: Norihiro Tanaka <noritnk@kcn.ne.jp>
Date:   Sat Mar 15 14:41:52 2014 +0900

    grep: use the Galil rule for Boyer-Moore algorithm in KWSet

    The Boyer-Moore algorithm is O(m*n), which means it may be much
    slower than the DFA.  Its Galil rule variant is O(n) and increases
    efficiency in the typical case; it skips sections that are known
    to match and does not compare more than once for a position in the text.
    To use the Galil rule, look for the delta2 shift at each position
    from the trie instead of the 'mind2' value.
    * src/kwset.c (struct kwset): Replace member 'mind2' with 'shift'.
    (kwsprep): Look for the delta2 shift.
    (bmexec): Use it.

--=20
You are receiving this mail because:
You are the assignee for the bug.=



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?bug-258616-227-9lkk4aPs4k>