]> CyberLeo.Net >> Repos - FreeBSD/stable/9.git/commit
MFC r228395 (by ed):
authordim <dim@ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f>
Tue, 9 Aug 2016 18:53:57 +0000 (18:53 +0000)
committerdim <dim@ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f>
Tue, 9 Aug 2016 18:53:57 +0000 (18:53 +0000)
commitb6b0a9902ca90e137586f053f4b04f9cde394e47
tree1ee7bbfb12a66699d11feaea022f2545f50262f5
parent358900d4e3a42cfd26a91f27f0b3023b32c1196b
MFC r228395 (by ed):

Add missing "static const" to long options table.

This table is only used in this C file and passed to getopt_long(), so
we can safely add static and const to it.

MFC r241737 (by ed):

More -Wmissing-variable-declarations fixes.

MFC r270132 (by gabor):

- Do not look for more matching lines if -L is specified

Submitted by:   eadler (based on)

MFC r296799 (by ian):

Fix a bug in bsdgrep that caused the program to hang in a tight loop for
some combinations of command line options and search patterns.  The code was
examining regexec flags looking for a regcomp flag value.  The fix is to
look in the struct field where the decoded regcomp flag was stored when the
regex was compiled.

With this fix, it's possible to build WITHOUT_GNU_GREP_COMPAT and
WITH_BSDGREP and have a usable GPL-free grep (which of course lacks gnugrep
extensions).  It now passes the kyua tests except for one test that requires
the -z/--null-data gnu extension, and one test involving outputting context
lines across multiple files which appears to sometimes output an extra
delimiter line ("--") between matches (a rather obscure failure of a rather
obscure feature, so bsdgrep should be generally usable now).

MFC r303676:

Fix a segfault in bsdgrep when parsing the invalid extended regexps "?"
or "+" (these are invalid, because there is no preceding operand).

When bsdgrep attempts to emulate GNU grep in discarding and ignoring the
invalid ? or + operators, some later logic in tre_compile_fast() goes
beyond the end of the buffer, leading to a crash.

Fix this by bailing out, and reporting a bad pattern instead.

Reported by: Steve Kargl

git-svn-id: svn://svn.freebsd.org/base/stable/9@303883 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
usr.bin/grep/grep.c
usr.bin/grep/regex/glue.h
usr.bin/grep/regex/tre-fastmatch.c
usr.bin/grep/regex/xmalloc.c
usr.bin/grep/util.c