emaste
5249e4567c
bsdgrep: Correct per-line line metadata printing
...
Metadata printing with -b, -H, or -n flags suffered from a few flaws:
1) -b/offset printing was broken when used in conjunction with -o
2) With -o, bsdgrep did not print metadata for every match/line, just
the first match of a line
3) There were no tests for this
Address these issues by outputting this data per-match if the -o flag is
specified, and prior to outputting any matches if -o but not --color,
since --color alone will not generate a new line of output for every
iteration over the matches.
To correct -b output, fudge the line offset as we're printing matches.
While here, make sure we're using grep_printline in -A context. Context
printing should *never* look at the parsing context, just the line.
The tests included do not pass with gnugrep in base due to it exhibiting
similar quirky behavior that bsdgrep previously exhibited.
Submitted by: Kyle Evans <kevans91@ksu.edu>
Reviewed by: cem
Differential Revision: https://reviews.freebsd.org/D10580
2017-05-20 11:20:03 +00:00
..
2016-04-21 12:58:29 +00:00
2017-02-28 23:42:47 +00:00
2016-06-16 21:22:26 +00:00
2016-07-30 06:32:18 +00:00
2017-02-11 20:19:04 +00:00
2017-03-09 03:27:53 +00:00
2017-04-13 23:22:18 +00:00
2017-02-28 23:42:47 +00:00
2017-03-05 16:10:35 +00:00
2017-02-28 23:42:47 +00:00
2017-02-11 20:27:53 +00:00
2017-05-10 22:45:05 +00:00
2017-03-20 13:02:27 +00:00
2017-03-31 03:11:25 +00:00
2017-03-12 18:58:44 +00:00
2017-03-12 18:58:44 +00:00
2017-05-08 14:33:38 +00:00
2017-02-28 23:42:47 +00:00
2016-05-13 05:49:02 +00:00
2017-01-04 16:24:40 +00:00
2017-02-28 23:42:47 +00:00
2017-03-12 18:58:44 +00:00
2017-03-12 18:58:44 +00:00
2017-02-28 23:42:47 +00:00
2017-01-27 20:01:46 +00:00
2017-02-28 23:42:47 +00:00
2017-03-23 03:28:24 +00:00
2017-02-28 23:42:47 +00:00
2016-04-17 23:02:49 +00:00
2017-02-28 23:42:47 +00:00
2017-02-28 23:42:47 +00:00
2017-02-28 23:42:47 +00:00
2017-03-12 18:58:44 +00:00
2017-02-28 23:42:47 +00:00
2017-03-20 13:02:27 +00:00
2016-07-29 21:18:20 +00:00
2017-05-08 15:51:29 +00:00
2017-02-28 23:42:47 +00:00
2017-03-12 18:58:44 +00:00
2017-02-28 23:42:47 +00:00
2016-04-21 12:58:29 +00:00
2017-03-05 16:10:35 +00:00
2017-04-24 20:34:56 +00:00
2017-02-28 23:42:47 +00:00
2017-03-12 18:58:44 +00:00
2017-04-17 17:23:19 +00:00
2017-02-28 23:42:47 +00:00
2017-03-12 18:58:44 +00:00
2017-03-12 18:58:44 +00:00
2016-11-13 00:11:30 +00:00
2017-02-06 08:27:19 +00:00
2017-02-28 23:42:47 +00:00
2017-02-28 23:42:47 +00:00
2017-03-12 18:58:44 +00:00
2017-02-28 23:42:47 +00:00
2016-03-29 11:56:00 +00:00
2017-03-12 18:58:44 +00:00
2016-05-04 23:20:53 +00:00
2017-02-28 23:42:47 +00:00
2017-02-28 23:42:47 +00:00
2017-02-28 23:42:47 +00:00
2017-05-09 01:48:23 +00:00
2017-04-04 19:46:23 +00:00
2017-02-28 23:42:47 +00:00
2017-02-28 23:42:47 +00:00
2017-03-12 18:58:44 +00:00
2017-03-30 18:21:36 +00:00
2016-05-10 11:12:31 +00:00
2017-05-09 01:48:14 +00:00
2017-05-18 01:46:30 +00:00
2016-06-04 21:34:06 +00:00
2016-11-13 00:11:30 +00:00
2017-02-28 23:42:47 +00:00
2017-05-20 11:20:03 +00:00
2017-02-06 07:02:17 +00:00
2017-02-28 23:42:47 +00:00
2017-05-09 01:48:23 +00:00
2017-03-12 18:58:44 +00:00
2017-05-09 01:48:23 +00:00
2017-02-28 23:42:47 +00:00
2017-05-09 01:48:23 +00:00
2017-05-18 17:15:58 +00:00
2017-03-12 18:58:44 +00:00
2017-03-12 18:58:44 +00:00
2017-02-28 23:42:47 +00:00
2017-02-28 23:42:47 +00:00
2017-04-25 21:59:34 +00:00
2017-02-28 23:42:47 +00:00
2017-05-09 01:48:23 +00:00
2017-05-09 01:48:23 +00:00
2017-05-09 01:48:23 +00:00
2017-02-28 23:42:47 +00:00
2016-05-16 16:01:46 +00:00
2017-02-28 23:42:47 +00:00
2017-05-05 14:33:39 +00:00
2017-03-12 18:58:44 +00:00
2017-03-12 18:58:44 +00:00
2017-03-12 18:58:44 +00:00
2017-04-04 19:46:23 +00:00
2017-03-12 18:58:44 +00:00
2017-05-14 18:47:09 +00:00
2017-03-01 02:10:40 +00:00
2017-02-28 23:42:47 +00:00
2017-02-28 23:42:47 +00:00
2017-02-28 23:42:47 +00:00
2017-02-28 23:42:47 +00:00
2017-02-28 23:42:47 +00:00
2017-02-28 23:42:47 +00:00
2017-03-12 18:58:44 +00:00
2017-03-12 18:58:44 +00:00
2017-02-28 23:42:47 +00:00
2017-03-12 10:56:19 +00:00
2017-03-12 18:58:44 +00:00
2017-02-28 23:42:47 +00:00
2017-03-12 18:58:44 +00:00
2017-05-09 01:48:23 +00:00
2017-03-12 18:58:44 +00:00
2017-03-12 18:58:44 +00:00
2017-02-28 23:42:47 +00:00
2017-03-12 18:58:44 +00:00
2017-03-12 18:58:44 +00:00
2017-02-28 23:42:47 +00:00
2017-05-10 09:36:34 +00:00
2017-03-12 18:58:44 +00:00
2017-02-28 23:42:47 +00:00
2017-02-28 23:42:47 +00:00
2017-05-10 16:06:22 +00:00
2017-02-28 23:42:47 +00:00
2017-05-11 13:46:30 +00:00
2017-03-12 18:58:44 +00:00
2016-11-05 14:08:14 +00:00
2017-04-16 19:17:10 +00:00
2016-05-01 08:22:11 +00:00
2016-08-30 19:02:15 +00:00
2017-02-28 23:42:47 +00:00
2017-02-28 23:42:47 +00:00
2016-07-31 19:02:19 +00:00
2016-04-21 12:58:29 +00:00
2017-02-28 23:42:47 +00:00
2016-05-17 12:52:31 +00:00
2017-03-12 18:58:44 +00:00
2017-03-12 18:58:44 +00:00
2017-03-12 18:58:44 +00:00
2017-02-28 23:42:47 +00:00
2017-03-12 18:58:44 +00:00
2017-03-07 05:10:38 +00:00
2017-02-28 23:42:47 +00:00
2017-03-05 16:10:35 +00:00
2016-07-09 04:56:28 +00:00
2017-02-11 23:45:50 +00:00
2017-05-09 01:48:23 +00:00
2017-04-05 16:13:36 +00:00
2016-09-30 13:50:59 +00:00
2017-02-28 23:42:47 +00:00
2017-04-29 21:48:11 +00:00
2017-05-02 21:09:07 +00:00
2017-05-15 22:52:25 +00:00
2017-02-28 23:42:47 +00:00
2016-06-08 02:14:05 +00:00
2016-04-07 04:23:25 +00:00
2017-03-12 18:58:44 +00:00
2017-02-28 23:42:47 +00:00
2017-05-18 19:42:19 +00:00
2017-02-28 23:42:47 +00:00
2017-02-11 23:39:56 +00:00
2017-02-28 23:42:47 +00:00
2017-01-12 14:44:41 +00:00
2017-04-04 19:46:23 +00:00
2017-02-28 23:42:47 +00:00
2017-03-12 18:58:44 +00:00
2017-02-28 23:42:47 +00:00
2017-03-04 04:06:33 +00:00
2017-02-28 23:42:47 +00:00
2017-02-28 23:42:47 +00:00
2017-02-28 23:42:47 +00:00
2017-02-28 23:42:47 +00:00
2017-04-08 08:42:25 +00:00
2017-04-24 16:52:26 +00:00
2016-09-16 14:23:16 +00:00
2017-02-28 23:42:47 +00:00
2017-02-28 23:42:47 +00:00
2016-04-21 12:58:29 +00:00
2017-03-12 18:58:44 +00:00
2017-03-21 08:57:20 +00:00
2017-03-23 03:28:24 +00:00
2017-02-17 19:53:20 +00:00
2017-02-28 23:42:47 +00:00
2016-04-26 00:29:00 +00:00
2016-04-21 12:58:29 +00:00
2017-02-28 23:42:47 +00:00
2017-03-12 18:58:44 +00:00
2017-04-20 22:30:39 +00:00
2017-02-28 23:42:47 +00:00
2017-02-28 23:42:47 +00:00
2017-03-24 00:02:12 +00:00
2017-02-28 23:42:47 +00:00
2017-02-28 23:42:47 +00:00
2017-03-12 18:58:44 +00:00
2016-05-04 23:20:53 +00:00
2017-03-12 18:58:44 +00:00
2017-02-28 23:42:47 +00:00
2017-03-09 04:20:00 +00:00
2017-04-22 09:38:43 +00:00
2017-05-18 12:55:07 +00:00
2017-02-28 23:42:47 +00:00
2017-02-28 23:42:47 +00:00
2017-02-28 23:42:47 +00:00
2017-02-28 23:42:47 +00:00
2016-05-04 23:20:53 +00:00
2017-05-03 16:03:33 +00:00
2017-02-28 23:42:47 +00:00
2017-02-28 23:42:47 +00:00
2017-02-28 23:42:47 +00:00
2016-07-11 08:05:46 +00:00
2017-02-28 23:42:47 +00:00
2017-04-29 06:41:51 +00:00
2017-05-15 20:18:14 +00:00
2017-02-11 23:38:28 +00:00
2017-03-12 18:58:44 +00:00
2017-02-11 23:37:48 +00:00
2017-02-28 23:42:47 +00:00
2017-02-28 23:42:47 +00:00
2017-03-10 06:23:15 +00:00
2017-03-12 18:58:44 +00:00
2017-02-28 23:42:47 +00:00
2017-03-12 18:58:44 +00:00
2017-03-12 18:58:44 +00:00
2017-04-21 00:00:23 +00:00
2016-09-14 18:22:12 +00:00
2017-03-12 18:58:44 +00:00
2017-02-28 23:42:47 +00:00
2017-02-28 23:42:47 +00:00
2017-02-28 23:42:47 +00:00
2016-05-01 16:13:05 +00:00
2017-04-19 19:55:38 +00:00
2017-02-28 23:42:47 +00:00
2017-02-28 23:42:47 +00:00
2017-02-28 23:42:47 +00:00
2017-02-28 23:42:47 +00:00
2017-03-12 18:58:44 +00:00
2016-11-08 23:59:41 +00:00
2017-05-16 18:46:56 +00:00
2017-02-28 23:42:47 +00:00
2017-03-12 18:58:44 +00:00
2017-03-12 18:58:44 +00:00
2017-03-12 18:58:44 +00:00
2017-02-28 23:42:47 +00:00
2017-03-12 18:58:44 +00:00
2017-05-09 01:48:14 +00:00
2017-05-01 19:34:15 +00:00