freebsd-dev/usr.bin/grep
Kyle Evans 05ad821531 bsdgrep: add a primitive literal matcher
fgrep/grep -F will error out at runtime if compiled with a regex(3)
that does not define REG_NOSPEC or REG_LITERAL. glibc is one such regex(3)
implementation, and as it turns out they don't support literal matching at
all.

Provide a primitive literal matcher for use with glibc and other
implementations that don't support literal matching so that we don't
completely lose fgrep/grep -F if compiled against libgnuregex on stable/10,
stable/11, or other systems that we don't necessarily support.

This is a wholly unoptimized implementation with no plans to optimize it as
of now. This is due to both its use-case being primarily on unsupported
systems in the near-distant future and that it's reinventing the wheel that
we already have available as a feature of regex(3).

Reviewed by:	cem, emaste, ngie
Approved by:	emaste (mentor)
MFC after:	2 weeks
Differential Revision:	https://reviews.freebsd.org/D12056
2017-08-24 01:23:33 +00:00
..
nls bsdgrep: correct nls usage data after r317049 2017-05-02 13:47:15 +00:00
regex bsdgrep: use safer sizeof() construct 2017-05-26 03:35:59 +00:00
tests Update copyright e-mail address to @FreeBSD.org address 2017-07-06 19:53:30 +00:00
file.c bsdgrep: fix segfault with --mmap 2017-05-20 00:42:47 +00:00
grep.1 bsdgrep: add -z/--null-data support 2017-04-17 13:14:18 +00:00
grep.c bsdgrep: add a primitive literal matcher 2017-08-24 01:23:33 +00:00
grep.h bsdgrep: add a primitive literal matcher 2017-08-24 01:23:33 +00:00
Makefile Add HAS_TESTS to all Makefiles that are currently using the 2017-08-02 08:50:42 +00:00
Makefile.depend DIRDEPS_BUILD: Update dependencies. 2017-05-09 01:48:23 +00:00
queue.c bsdgrep: Correct per-line line metadata printing 2017-05-20 11:20:03 +00:00
util.c bsdgrep: add a primitive literal matcher 2017-08-24 01:23:33 +00:00