Created attachment 154549 [details] fix for broken -f option in bsdgrep In r268799 the read_patterns function of grep.c was changed to use getline(3) instead of fgetln(3). The necessary change to the add_pattern call parameters is missing which breaks the -f option. The NetBSD grep.c (CVS Rev. 1.6) change that was supposed to be imported in this commit does not contain the mistake. The test that is supposed to ensure that -f works is unfortunately only run with GNU grep (unless WITH_BSD_GREP=true is set).
Over to committer of https://svnweb.freebsd.org/base?view=revision&revision=268799 .
A commit references this bug: Author: pfg Date: Sat Mar 21 00:21:31 UTC 2015 New revision: 280307 URL: https://svnweb.freebsd.org/changeset/base/280307 Log: bsdgrep: fix regression in the -f option since r268799 Caused by an incomplete merge from NetBSD. PR: 198725 MFC after: 3 days Changes: head/usr.bin/grep/grep.c
A commit references this bug: Author: pfg Date: Tue Mar 24 01:31:03 UTC 2015 New revision: 280408 URL: https://svnweb.freebsd.org/changeset/base/280408 Log: MFC r280307: bsdgrep: fix regression in the -f option since r268799 Caused by an incomplete merge from NetBSD. PR: 198725 Changes: _U stable/10/ stable/10/usr.bin/grep/grep.c
A commit references this bug: Author: pfg Date: Tue Mar 24 01:32:47 UTC 2015 New revision: 280409 URL: https://svnweb.freebsd.org/changeset/base/280409 Log: MFC r280307: bsdgrep: fix regression in the -f option since r268799 Caused by an incomplete merge from NetBSD. PR: 198725 Changes: _U stable/9/usr.bin/grep/ stable/9/usr.bin/grep/grep.c
Huge thanks for finding the bug I introduced!