<feed xmlns='http://www.w3.org/2005/Atom'>
<title>src/usr.bin/grep/tests, branch main</title>
<subtitle>FreeBSD source tree</subtitle>
<id>http://cgit.freebsd.org/src/atom?h=main</id>
<link rel='self' href='http://cgit.freebsd.org/src/atom?h=main'/>
<link rel='alternate' type='text/html' href='http://cgit.freebsd.org/src/'/>
<updated>2026-01-12T15:34:43Z</updated>
<entry>
<title>grep/tests: Fix up the zgrep executable path in a newly added test</title>
<updated>2026-01-12T15:34:43Z</updated>
<author>
<name>Mark Johnston</name>
<email>markj@FreeBSD.org</email>
</author>
<published>2026-01-12T13:56:56Z</published>
<link rel='alternate' type='text/html' href='http://cgit.freebsd.org/src/commit/?id=045112f148fa092c92ec53204708f638b226ff8f'/>
<id>urn:sha1:045112f148fa092c92ec53204708f638b226ff8f</id>
<content type='text'>
Fixes:	da5d94d29a5e ("Remove obsolete BUGS section from zgrep(1) man page, add test")
</content>
</entry>
<entry>
<title>Remove obsolete BUGS section from zgrep(1) man page, add test</title>
<updated>2026-01-11T17:53:55Z</updated>
<author>
<name>Craig Leres</name>
<email>leres@FreeBSD.org</email>
</author>
<published>2026-01-10T00:34:39Z</published>
<link rel='alternate' type='text/html' href='http://cgit.freebsd.org/src/commit/?id=da5d94d29a5ec29817476c39ae2b2ad1666c3f06'/>
<id>urn:sha1:da5d94d29a5ec29817476c39ae2b2ad1666c3f06</id>
<content type='text'>
I forgot to check/update the man page with D54217. While here add
a test for multiple -e flags.

Reviewed by:	markj
Approved by:	markj
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D54632
</content>
</entry>
<entry>
<title>grep: add testcase to test color when matches is greater than MAX_MATCHES</title>
<updated>2026-01-09T23:22:48Z</updated>
<author>
<name>Viacheslav Chimishuk</name>
<email>vchimishuk@yandex.ru</email>
</author>
<published>2024-10-06T22:18:17Z</published>
<link rel='alternate' type='text/html' href='http://cgit.freebsd.org/src/commit/?id=0a5535d1c5209e73c6b2f3fd6118f9ffcb7e296e'/>
<id>urn:sha1:0a5535d1c5209e73c6b2f3fd6118f9ffcb7e296e</id>
<content type='text'>
Reviewed by: imp, kevans
Pull Request: https://github.com/freebsd/freebsd-src/pull/1442
</content>
</entry>
<entry>
<title>Fix zgrep(1) wrapper regression, add test</title>
<updated>2025-12-14T21:15:36Z</updated>
<author>
<name>Craig Leres</name>
<email>leres@FreeBSD.org</email>
</author>
<published>2025-12-13T23:43:02Z</published>
<link rel='alternate' type='text/html' href='http://cgit.freebsd.org/src/commit/?id=80726c2257e9d6d79341aac65ba22987f53619bc'/>
<id>urn:sha1:80726c2257e9d6d79341aac65ba22987f53619bc</id>
<content type='text'>
@bdrewery reported D48873 broke "bzgrep -q '1 2' /var/log/messages.0.bz2"
The mistake was in using $* instead of "$@" (I suspect $* is never right).

Reported by:	bdrewery
Reviewed by:	markj
Approved by:	markj
Fixes:		1070477cc8b7 ("Fix remaining zgrep(1) wrapper script regressions")
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D54217
</content>
</entry>
<entry>
<title>grep: avoid duplicated lines when we're coloring output</title>
<updated>2025-03-20T04:34:13Z</updated>
<author>
<name>Kyle Evans</name>
<email>kevans@FreeBSD.org</email>
</author>
<published>2025-03-20T04:34:13Z</published>
<link rel='alternate' type='text/html' href='http://cgit.freebsd.org/src/commit/?id=4c9ffb13dd74159bd3ed7e1c4c706dbd15a70df2'/>
<id>urn:sha1:4c9ffb13dd74159bd3ed7e1c4c706dbd15a70df2</id>
<content type='text'>
For the default uncolored output, we'll just output a line once and then
move on.  For colored output, we'll output multiple matches per
line with context from the line interspersed and may end up writing out
some match context multiple times as we don't persist which part of the
lines have already been printed.

Fix it by tracking the length of line printed thus far in printline()
and retaining it across successive calls to printline() in the same
line.  printline() should indicate whether it terminated the line or not
to avoid tracking the logic for that in multiple places: -o lines are
always terminated, so it's generally only some --color contexts where we
wouldn't have terminated.

Add a test to make sure that we're only printing one line going forward.

Reported and tested by:	Jamie Landeg-Jones &lt;jamie catflap org&gt;
Reviewed by:	emaste
Differential Revision:	https://reviews.freebsd.org/D49324
</content>
</entry>
<entry>
<title>Remove residual blank line at start of Makefile</title>
<updated>2024-07-15T22:43:39Z</updated>
<author>
<name>Warner Losh</name>
<email>imp@FreeBSD.org</email>
</author>
<published>2024-07-15T04:46:32Z</published>
<link rel='alternate' type='text/html' href='http://cgit.freebsd.org/src/commit/?id=e9ac41698b2f322d55ccf9da50a3596edb2c1800'/>
<id>urn:sha1:e9ac41698b2f322d55ccf9da50a3596edb2c1800</id>
<content type='text'>
This is a residual of the $FreeBSD$ removal.

MFC After: 3 days (though I'll just run the command on the branches)
Sponsored by: Netflix
</content>
</entry>
<entry>
<title>Remove $FreeBSD$: one-line sh pattern</title>
<updated>2023-08-16T17:55:03Z</updated>
<author>
<name>Warner Losh</name>
<email>imp@FreeBSD.org</email>
</author>
<published>2023-08-16T17:55:03Z</published>
<link rel='alternate' type='text/html' href='http://cgit.freebsd.org/src/commit/?id=d0b2dbfa0ecf2bbc9709efc5e20baf8e4b44bbbf'/>
<id>urn:sha1:d0b2dbfa0ecf2bbc9709efc5e20baf8e4b44bbbf</id>
<content type='text'>
Remove /^\s*#[#!]?\s*\$FreeBSD\$.*$\n/
</content>
</entry>
<entry>
<title>spdx: The BSD-2-Clause-FreeBSD identifier is obsolete, drop -FreeBSD</title>
<updated>2023-05-12T16:44:03Z</updated>
<author>
<name>Warner Losh</name>
<email>imp@FreeBSD.org</email>
</author>
<published>2023-05-10T15:40:58Z</published>
<link rel='alternate' type='text/html' href='http://cgit.freebsd.org/src/commit/?id=4d846d260e2b9a3d4d0a701462568268cbfe7a5b'/>
<id>urn:sha1:4d846d260e2b9a3d4d0a701462568268cbfe7a5b</id>
<content type='text'>
The SPDX folks have obsoleted the BSD-2-Clause-FreeBSD identifier. Catch
up to that fact and revert to their recommended match of BSD-2-Clause.

Discussed with:		pfg
MFC After:		3 days
Sponsored by:		Netflix
</content>
</entry>
<entry>
<title>grep: properly switch EOL indicator with -z</title>
<updated>2023-01-04T05:37:54Z</updated>
<author>
<name>Kyle Evans</name>
<email>kevans@FreeBSD.org</email>
</author>
<published>2023-01-04T05:21:10Z</published>
<link rel='alternate' type='text/html' href='http://cgit.freebsd.org/src/commit/?id=e898a3af97f97f74c0fb22032bbd163f7cc92a05'/>
<id>urn:sha1:e898a3af97f97f74c0fb22032bbd163f7cc92a05</id>
<content type='text'>
-z is supposed to use only the NUL byte as EOL, but we were
inadvertently using both newline and NUL due to REG_NEWLINE in cflags.

The odds of anyone relying on this bsdgrep-specific bug are quite low,
so let's just fix it.  At least one port in the wild has been reported
to expect the intended behavior.

Reported by:	Hill Ma &lt;maahiuzeon@gmail.com&gt;
Triaged by:	the self-proclaimed peanut gallery on Discord
</content>
</entry>
<entry>
<title>grep: tests: stop testing for a nonexistent version of grep</title>
<updated>2020-12-25T21:16:33Z</updated>
<author>
<name>Kyle Evans</name>
<email>kevans@FreeBSD.org</email>
</author>
<published>2020-12-22T21:39:12Z</published>
<link rel='alternate' type='text/html' href='http://cgit.freebsd.org/src/commit/?id=d1c965f1436aae22127485370332555ec01b3a23'/>
<id>urn:sha1:d1c965f1436aae22127485370332555ec01b3a23</id>
<content type='text'>
Differential Revision:	https://reviews.freebsd.org/D27732
</content>
</entry>
</feed>
