kevans
fcd2c3120c
bsdgrep(1): various fixes of empty pattern/exit code/-c behavior
...
When an empty pattern is encountered in the pattern list, I had previously
broken bsdgrep to count that as a "match all" and ignore any other patterns
in the list. This commit rectifies that mistake, among others:
- The -v flag semantics were not quite right; lines matched should have been
counted differently based on whether the -v flag was set or not. procline
now definitively returns whether it's matched or not, and interpreting
that result has been kicked up a level.
- Empty patterns with the -x flag was broken similarly to empty patterns
with the -w flag. The former is a whole-line match and should be more
strict, only matching blank lines. No -x and no -w will will match the
empty string at the beginning of each line.
- The exit code with -L was broken, w.r.t. modern grep. Modern grap will
exit(0) if any file that didn't match was output, so our interpretation
was simply backwards. The new interpretation makes sense to me.
Tests updated and added to try and catch some of this.
This misbehavior was found by autoconf while fixing ports found in PR 229925
expecting either a more sane or a more GNU-like sed.
MFC after: 1 week
2019-09-25 17:14:43 +00:00
..
2017-10-31 00:07:04 +00:00
2018-08-08 21:21:28 +00:00
2019-09-01 16:51:25 +00:00
2017-11-27 15:37:16 +00:00
2018-08-11 16:29:54 +00:00
2017-10-31 00:07:04 +00:00
2019-06-15 17:08:13 +00:00
2017-11-20 19:49:47 +00:00
2018-06-19 23:43:14 +00:00
2019-01-12 12:35:02 +00:00
2017-11-20 19:49:47 +00:00
2019-07-19 15:10:03 +00:00
2018-12-23 01:05:52 +00:00
2019-04-17 16:18:14 +00:00
2019-06-12 13:34:12 +00:00
2019-07-18 07:37:26 +00:00
2019-08-28 21:01:51 +00:00
2019-08-28 21:01:51 +00:00
2017-11-27 15:37:16 +00:00
2017-11-27 15:37:16 +00:00
2017-10-31 00:07:04 +00:00
2019-09-16 20:43:20 +00:00
2017-11-20 19:49:47 +00:00
2017-10-31 00:07:04 +00:00
2017-10-31 00:07:04 +00:00
2018-04-19 12:50:49 +00:00
2017-11-20 19:49:47 +00:00
2019-06-04 13:00:49 +00:00
2019-03-11 22:23:56 +00:00
2018-06-19 23:43:14 +00:00
2017-11-20 19:49:47 +00:00
2017-12-28 05:33:44 +00:00
2017-11-20 19:49:47 +00:00
2017-10-31 00:07:04 +00:00
2019-01-18 00:26:25 +00:00
2019-07-12 05:19:06 +00:00
2019-09-01 21:20:31 +00:00
2017-11-27 15:37:16 +00:00
2017-11-20 19:49:47 +00:00
2019-03-06 15:19:04 +00:00
2018-05-23 09:16:20 +00:00
2017-10-31 00:07:04 +00:00
2019-09-04 13:44:46 +00:00
2018-11-04 19:24:49 +00:00
2018-11-04 19:24:49 +00:00
2018-06-19 23:43:14 +00:00
2019-07-19 15:10:53 +00:00
2017-10-31 00:07:04 +00:00
2019-05-10 17:05:40 +00:00
2019-09-05 14:13:08 +00:00
2017-10-31 00:07:04 +00:00
2017-11-27 15:37:16 +00:00
2019-01-31 16:49:06 +00:00
2018-05-09 07:46:57 +00:00
2017-11-27 15:37:16 +00:00
2018-04-25 18:56:27 +00:00
2018-05-11 06:55:02 +00:00
2018-09-19 07:09:09 +00:00
2017-11-20 19:49:47 +00:00
2018-09-10 19:39:20 +00:00
2017-10-31 00:07:04 +00:00
2017-10-31 00:07:04 +00:00
2019-01-28 02:00:39 +00:00
2017-11-27 15:37:16 +00:00
2017-12-01 21:44:23 +00:00
2017-11-27 20:01:58 +00:00
2019-01-28 19:54:58 +00:00
2017-11-20 19:49:47 +00:00
2018-12-03 23:42:04 +00:00
2019-09-05 14:13:08 +00:00
2017-10-31 00:07:04 +00:00
2018-06-02 20:28:58 +00:00
2017-11-30 15:10:11 +00:00
2017-10-31 00:07:04 +00:00
2019-04-22 17:52:46 +00:00
2017-11-27 15:37:16 +00:00
2018-06-19 23:43:14 +00:00
2019-08-21 10:54:52 +00:00
2019-09-13 14:51:00 +00:00
2019-09-25 17:14:43 +00:00
2019-01-07 08:29:27 +00:00
2019-04-17 16:18:14 +00:00
2019-04-13 16:51:48 +00:00
2017-10-31 00:07:04 +00:00
2018-06-19 23:43:14 +00:00
2017-11-20 19:49:47 +00:00
2018-06-19 23:43:14 +00:00
2019-08-29 23:23:12 +00:00
2018-03-02 23:31:55 +00:00
2019-02-07 14:29:45 +00:00
2018-12-27 14:44:01 +00:00
2017-11-20 19:49:47 +00:00
2019-09-21 15:01:11 +00:00
2019-02-18 03:49:16 +00:00
2017-10-31 00:07:04 +00:00
2017-10-31 00:07:04 +00:00
2017-11-27 15:37:16 +00:00
2019-08-26 10:18:19 +00:00
2018-11-04 19:24:49 +00:00
2019-01-04 02:48:43 +00:00
2019-08-25 01:05:01 +00:00
2017-11-27 15:37:16 +00:00
2018-10-23 13:49:53 +00:00
2017-11-20 19:49:47 +00:00
2019-06-29 18:41:40 +00:00
2017-10-31 00:07:04 +00:00
2017-10-31 00:07:04 +00:00
2018-02-07 17:09:12 +00:00
2018-01-21 08:48:26 +00:00
2019-09-11 16:00:03 +00:00
2018-10-27 23:31:42 +00:00
2018-09-18 20:50:07 +00:00
2018-02-11 13:35:31 +00:00
2019-03-20 07:40:38 +00:00
2018-05-28 02:40:06 +00:00
2019-07-20 20:56:31 +00:00
2017-11-27 15:37:16 +00:00
2018-06-19 23:43:14 +00:00
2017-11-20 19:49:47 +00:00
2017-11-20 19:49:47 +00:00
2017-10-31 00:07:04 +00:00
2017-10-31 00:07:04 +00:00
2019-09-09 15:37:40 +00:00
2018-09-18 20:47:06 +00:00
2018-11-04 16:58:55 +00:00
2019-04-12 18:35:14 +00:00
2017-11-20 19:49:47 +00:00
2019-05-08 08:43:15 +00:00
2018-06-19 23:43:14 +00:00
2017-11-27 15:37:16 +00:00
2017-10-31 00:07:04 +00:00
2017-11-20 19:49:47 +00:00
2017-11-27 15:37:16 +00:00
2017-10-31 00:07:04 +00:00
2017-11-20 19:49:47 +00:00
2019-03-09 02:03:07 +00:00
2017-11-20 19:49:47 +00:00
2017-11-27 15:37:16 +00:00
2019-08-13 23:32:56 +00:00
2018-01-06 15:52:28 +00:00
2018-08-08 19:24:20 +00:00
2019-03-04 14:30:37 +00:00
2017-10-31 00:07:04 +00:00
2019-03-07 11:09:25 +00:00
2019-08-07 00:53:27 +00:00
2017-11-27 15:37:16 +00:00
2019-02-08 14:31:44 +00:00
2019-07-28 21:44:01 +00:00
2017-11-20 19:49:47 +00:00
2017-11-27 15:37:16 +00:00
2017-10-31 00:07:04 +00:00
2018-11-09 13:47:06 +00:00
2017-10-31 00:07:04 +00:00
2018-09-11 20:32:57 +00:00
2018-07-20 23:52:11 +00:00
2017-10-31 00:07:04 +00:00
2017-10-31 00:07:04 +00:00
2017-10-31 00:07:04 +00:00
2017-11-20 19:49:47 +00:00
2017-10-31 00:07:04 +00:00
2019-09-05 14:13:08 +00:00
2017-11-20 19:49:47 +00:00
2019-09-05 15:35:57 +00:00
2017-11-27 15:37:16 +00:00
2017-11-27 15:37:16 +00:00
2018-11-20 00:06:53 +00:00
2019-05-30 16:02:40 +00:00
2019-03-11 22:23:56 +00:00
2019-01-06 20:42:09 +00:00
2018-06-19 23:43:14 +00:00
2019-07-29 20:43:07 +00:00
2019-09-03 18:58:48 +00:00
2019-09-04 16:25:41 +00:00
2017-11-27 15:37:16 +00:00
2019-09-21 00:17:40 +00:00
2017-10-31 00:07:04 +00:00
2019-04-03 20:37:14 +00:00
2019-08-01 18:57:08 +00:00
2017-11-20 19:49:47 +00:00
2017-10-31 00:07:04 +00:00
2017-11-20 19:49:47 +00:00
2017-11-27 15:37:16 +00:00
2017-12-28 05:33:34 +00:00
2017-10-31 00:07:04 +00:00
2017-11-27 20:01:58 +00:00
2018-07-03 19:09:46 +00:00
2019-01-12 12:57:32 +00:00
2018-06-25 11:44:56 +00:00
2017-11-18 14:26:50 +00:00
2018-11-04 19:24:49 +00:00
2017-11-20 19:49:47 +00:00
2017-12-06 20:10:05 +00:00
2017-12-08 15:57:29 +00:00
2019-09-05 14:13:08 +00:00
2019-03-07 18:24:16 +00:00
2017-11-27 15:37:16 +00:00
2019-01-31 23:21:18 +00:00
2017-12-28 05:34:34 +00:00
2019-08-01 18:57:37 +00:00
2017-10-31 00:07:04 +00:00
2018-07-05 13:13:48 +00:00
2017-10-31 00:07:04 +00:00
2019-09-04 13:44:46 +00:00
2017-11-20 19:49:47 +00:00
2018-05-19 20:35:15 +00:00
2019-05-01 19:35:45 +00:00
2017-11-27 15:37:16 +00:00
2019-04-08 03:35:47 +00:00
2018-06-22 09:10:50 +00:00
2019-02-21 15:08:25 +00:00
2019-04-19 17:06:43 +00:00
2017-11-27 15:37:16 +00:00
2019-06-09 22:55:21 +00:00
2019-01-18 21:30:06 +00:00
2019-09-05 14:13:08 +00:00
2017-12-28 05:33:39 +00:00
2018-11-04 19:24:49 +00:00
2019-07-15 14:19:39 +00:00
2018-08-23 17:00:07 +00:00
2018-05-04 14:39:32 +00:00
2018-03-29 02:13:58 +00:00
2018-09-19 14:56:53 +00:00
2019-09-21 00:44:37 +00:00
2018-06-01 22:34:59 +00:00
2017-11-20 19:49:47 +00:00
2018-06-19 23:43:14 +00:00
2017-11-20 19:49:47 +00:00
2018-07-29 07:51:42 +00:00
2019-09-18 16:15:05 +00:00
2017-11-20 19:49:47 +00:00
2017-11-20 19:49:47 +00:00
2017-11-20 19:49:47 +00:00
2017-11-20 19:49:47 +00:00
2019-09-05 14:13:08 +00:00
2017-11-20 19:49:47 +00:00
2017-11-27 15:37:16 +00:00
2018-11-04 19:24:49 +00:00
2019-01-21 15:27:58 +00:00
2017-10-31 00:07:04 +00:00
2017-11-27 15:37:16 +00:00
2017-11-27 15:37:16 +00:00
2019-08-17 08:29:22 +00:00
2018-06-25 11:44:41 +00:00
2017-11-20 19:49:47 +00:00
2018-11-12 07:14:34 +00:00
2017-10-31 00:07:04 +00:00
2018-06-28 13:48:59 +00:00
2019-07-19 20:04:31 +00:00
2017-10-31 00:07:04 +00:00
2019-08-06 21:50:34 +00:00
2019-08-23 16:03:23 +00:00
2019-08-29 02:44:18 +00:00
2018-04-15 08:34:16 +00:00
2019-04-17 16:18:14 +00:00
2019-09-05 14:13:08 +00:00
2019-01-24 18:39:45 +00:00
2017-11-27 15:37:16 +00:00
2017-11-27 15:37:16 +00:00
2019-08-08 21:15:02 +00:00
2019-01-23 20:02:17 +00:00
2017-12-27 03:23:01 +00:00
2019-08-12 10:57:56 +00:00
2017-10-31 00:07:04 +00:00
2019-05-06 20:20:21 +00:00
2017-11-20 19:49:47 +00:00
2017-10-31 00:07:04 +00:00
2017-10-31 00:07:04 +00:00
2017-10-31 00:07:04 +00:00
2018-06-19 23:43:14 +00:00
2017-11-27 15:37:16 +00:00
2017-11-27 15:37:16 +00:00
2017-11-27 15:37:16 +00:00
2019-04-19 02:54:13 +00:00
2019-09-10 07:54:49 +00:00