freebsd-skq/usr.bin/grep
kevans 985dd72ad9 bsdgrep: Fix --include/--exclude ordering issues
Prior to r332851:
* --exclude always win out over --include
* --exclude-dir always wins out over --include-dir

r332851 broke that behavior, resulting in:
* First of --exclude, --include wins
* First of --exclude-dir, --include-dir wins

As it turns out, both behaviors are wrong by modern grep standards- the
latest rule wins. e.g.:

`grep --exclude foo --include foo 'thing' foo`
foo is included

`grep --include foo --exclude foo 'thing' foo`
foo is excluded

As tested with GNU grep 3.1.

This commit makes bsdgrep follow this behavior.

Reported by:	se
2018-04-21 13:46:07 +00:00
..
nls bsdgrep: correct nls usage data after r317049 2017-05-02 13:47:15 +00:00
regex various: general adoption of SPDX licensing ID tags. 2017-11-27 15:37:16 +00:00
tests grep test: Fix copyright notice 2017-12-03 02:23:29 +00:00
file.c bsdgrep: if chain => switch 2018-04-21 01:42:02 +00:00
grep.1 bsdgrep: add -z/--null-data support 2017-04-17 13:14:18 +00:00
grep.c various: general adoption of SPDX licensing ID tags. 2017-11-27 15:37:16 +00:00
grep.h various: general adoption of SPDX licensing ID tags. 2017-11-27 15:37:16 +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-10-31 00:07:04 +00:00
queue.c various: general adoption of SPDX licensing ID tags. 2017-11-27 15:37:16 +00:00
util.c bsdgrep: Fix --include/--exclude ordering issues 2018-04-21 13:46:07 +00:00