<feed xmlns='http://www.w3.org/2005/Atom'>
<title>src/usr.bin/diff/tests, branch releng/14.4</title>
<subtitle>FreeBSD source tree</subtitle>
<id>https://cgit-dev.freebsd.org/src/atom?h=releng%2F14.4</id>
<link rel='self' href='https://cgit-dev.freebsd.org/src/atom?h=releng%2F14.4'/>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src/'/>
<updated>2026-02-11T06:14:46Z</updated>
<entry>
<title>diff: Correctly declare tests</title>
<updated>2026-02-11T06:14:46Z</updated>
<author>
<name>Dag-Erling Smørgrav</name>
<email>des@FreeBSD.org</email>
</author>
<published>2026-02-05T16:21:22Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src/commit/?id=7cf7c711d979fe06e58acade08e6b5e5f460e4c8'/>
<id>urn:sha1:7cf7c711d979fe06e58acade08e6b5e5f460e4c8</id>
<content type='text'>
Approved by:	re (cperciva)
Sponsored by:	Klara, Inc.
Fixes:		5fc739eb5949 ("diff: Fix integer overflows in Stone algorithm")
Fixes:		270492602b9b ("diff: Add test case for pagination resource leak")
Fixes:		590126789c84 ("diff: Don't compare a file or directory to itself")

(cherry picked from commit 157d6664aeb815db3b758bd3038fd1512a0f4e2c)
(cherry picked from commit b8bcf04d6dd37308834ee258230082ae6875b1f3)
</content>
</entry>
<entry>
<title>diff: Don't compare a file or directory to itself</title>
<updated>2026-02-11T06:14:30Z</updated>
<author>
<name>Dag-Erling Smørgrav</name>
<email>des@FreeBSD.org</email>
</author>
<published>2026-02-05T14:39:57Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src/commit/?id=b4139147bbb7e368316bee86ffac0fdb79319839'/>
<id>urn:sha1:b4139147bbb7e368316bee86ffac0fdb79319839</id>
<content type='text'>
While here, stop abusing struct dirent for something we don't even need
to store.

Approved by:	re (cperciva)
PR:		254455
MFC after:	1 week
Sponsored by:	Klara, Inc.
Reviewed by:	thj, kevans
Differential Revision:	https://reviews.freebsd.org/D55113

(cherry picked from commit 590126789c841d80655869bc075c8980c173dd1c)

diff: Fix build

rc must be defined first.

Fixes:		590126789c84
MFC after:	1 week
X-MFC with:	590126789c84

(cherry picked from commit ee44ab936e84bacaa49847d36aabdf280f9fecce)
(cherry picked from commit 7f412c6f88edc3aafb53a83f1743ad49da4679a9)
</content>
</entry>
<entry>
<title>diff: Fix pagination leak</title>
<updated>2026-02-11T06:14:26Z</updated>
<author>
<name>Dag-Erling Smørgrav</name>
<email>des@FreeBSD.org</email>
</author>
<published>2026-02-05T14:39:53Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src/commit/?id=6761e555376e375f89fe36c72f2813f5e64a7f63'/>
<id>urn:sha1:6761e555376e375f89fe36c72f2813f5e64a7f63</id>
<content type='text'>
* Drop an unnecessary variable and rename pidfd to procd.

* Rewinding stdout serves no purpose, so stop doing it.

* Don't bother freeing memory or setting the global status right
  before erroring out.

* Error out if dup(2) or dup2(2) fail.

* In the unlikely case that our pipe is equal to stdout, we need to
  record that information so we don't close it when cleaning up.

* Don't bother closing a descriptor before dup2(2)ing to it.

* Don't forget to close the the process descriptor after reaping the
  child process.

Approved by:	re (cperciva)
PR:		266592
MFC after:	1 week
Sponsored by:	Klara, Inc.
Reviewed by:	kevans, markj
Differential Revision:	https://reviews.freebsd.org/D55112

(cherry picked from commit c3904a7de78ca1ca15fcdf4c09f9d4be7f6fe6f5)
(cherry picked from commit 144455c333dc0d3db369596038de2e3dd6113b46)
</content>
</entry>
<entry>
<title>diff: Add test case for pagination resource leak</title>
<updated>2026-02-11T06:14:23Z</updated>
<author>
<name>Dag-Erling Smørgrav</name>
<email>des@FreeBSD.org</email>
</author>
<published>2026-02-05T14:39:47Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src/commit/?id=2434f3b279a90f9a47a963d5898eea610a94f6e0'/>
<id>urn:sha1:2434f3b279a90f9a47a963d5898eea610a94f6e0</id>
<content type='text'>
The pagination code leaks either processes or descriptors or both,
depending on the exact version of the code you have.  Add a test case
which exercises this leak to facilitate fixing it.

Approved by:	re (cperciva)
MFC after:	1 week
Sponsored by:	Klara, Inc.
Reviewed by:	thj, kevans
Differential Revision:	https://reviews.freebsd.org/D55111

(cherry picked from commit 270492602b9bd8b8fce4f021f055804978bf3f23)
(cherry picked from commit 51c2384ce049ec92e07901cf8a84c171e5d72104)
</content>
</entry>
<entry>
<title>diff: Fix integer overflows in Stone algorithm</title>
<updated>2026-02-11T06:14:04Z</updated>
<author>
<name>Dag-Erling Smørgrav</name>
<email>des@FreeBSD.org</email>
</author>
<published>2026-02-05T14:39:43Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src/commit/?id=238bf5ebf68429654caea62f00cb307d37c2a6bb'/>
<id>urn:sha1:238bf5ebf68429654caea62f00cb307d37c2a6bb</id>
<content type='text'>
Fix integer overflows that may occur when the context window is very
large and add tests to exercise those conditions.

Approved by:	re (cperciva)
PR:		267032
MFC after:	1 week
Sponsored by:	Klara, Inc.
Reviewed by:	thj, kevans
Differential Revision:	https://reviews.freebsd.org/D55110

(cherry picked from commit 5fc739eb5949620da911db2f87ca8faedc549d3a)
(cherry picked from commit 237fd8dd96979412dd65ce95032aa9957463d069)
</content>
</entry>
<entry>
<title>diff: Detect loops when diffing directories.</title>
<updated>2026-02-05T14:47:46Z</updated>
<author>
<name>Dag-Erling Smørgrav</name>
<email>des@FreeBSD.org</email>
</author>
<published>2025-06-20T11:10:35Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src/commit/?id=e8009e02e967618c58a033ace838561ba3400d38'/>
<id>urn:sha1:e8009e02e967618c58a033ace838561ba3400d38</id>
<content type='text'>
Sponsored by:	Klara, Inc.
Reviewed by:	markj
Differential Revision:	https://reviews.freebsd.org/D50936

(cherry picked from commit 42092e1b6625b8226de5f34d22b9a96c713626cb)
</content>
</entry>
<entry>
<title>diff: honour -B flag with -q</title>
<updated>2024-05-24T23:59:11Z</updated>
<author>
<name>Ed Maste</name>
<email>emaste@FreeBSD.org</email>
</author>
<published>2024-05-16T14:53:23Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src/commit/?id=1b7672ed992963e1c79ccc152f4afd72c91481f3'/>
<id>urn:sha1:1b7672ed992963e1c79ccc152f4afd72c91481f3</id>
<content type='text'>
PR:		278988
Reviewed by:	bapt
Sponsored by:	The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D45220

(cherry picked from commit fb623aab3927a6825ff7731198ec2e33426f7607)
</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='https://cgit-dev.freebsd.org/src/commit/?id=d0b2dbfa0ecf2bbc9709efc5e20baf8e4b44bbbf'/>
<id>urn:sha1:d0b2dbfa0ecf2bbc9709efc5e20baf8e4b44bbbf</id>
<content type='text'>
Remove /^\s*#[#!]?\s*\$FreeBSD\$.*$\n/
</content>
</entry>
<entry>
<title>diff: fix side-by-side output with tabbed input</title>
<updated>2022-12-14T01:31:21Z</updated>
<author>
<name>Kyle Evans</name>
<email>kevans@FreeBSD.org</email>
</author>
<published>2022-12-14T01:31:21Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src/commit/?id=8bf187f35b6298b7848c5ecf45b0b714327090d9'/>
<id>urn:sha1:8bf187f35b6298b7848c5ecf45b0b714327090d9</id>
<content type='text'>
The previous logic conflated some things... in this block:
- j: input characters rendered so far
- nc: number of characters in the line
- col: columns rendered so far
- hw: column width ((h)ard (w)idth?)

Comparing j to hw or col to nc are naturally wrong, as col and hw are
limits on their respective counters and nc is already brought down to hw
if the input line should be truncated to start with.

Right now, we end up easily truncating lines with tabs in them as we
count each tab for $tabwidth lines in the input line, but we really
should only be accounting for them in the column count.  The problem is
most easily demonstrated by the two input files added for the tests,
the two tabbed lines lose at least a word or two even though there's
plenty of space left in the row for each side.

Reviewed by:	bapt, pstef
Sponsored by:	Klara, Inc.
Differential Revision:	https://reviews.freebsd.org/D37676
</content>
</entry>
<entry>
<title>diff: tests: loosen up requirements for report_identical</title>
<updated>2022-04-19T04:04:13Z</updated>
<author>
<name>Kyle Evans</name>
<email>kevans@FreeBSD.org</email>
</author>
<published>2022-04-19T04:04:13Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src/commit/?id=efba49ee5a64f8f56f49e58887484284d785d542'/>
<id>urn:sha1:efba49ee5a64f8f56f49e58887484284d785d542</id>
<content type='text'>
This test cannot run without an unprivileged_user being specified
anyways, so just run as the unprivileged user.  Revoking read permisions
works just as well if you're guaranteed non-root.

Reviewed by:	pstef
Sponsored by:	Klara, Inc.
Differential Revision:	https://reviews.freebsd.org/D34950
</content>
</entry>
</feed>
