<feed xmlns='http://www.w3.org/2005/Atom'>
<title>src/usr.bin/diff/diffreg.c, branch release/13.1.0</title>
<subtitle>FreeBSD source tree</subtitle>
<id>https://cgit-dev.freebsd.org/src/atom?h=release%2F13.1.0</id>
<link rel='self' href='https://cgit-dev.freebsd.org/src/atom?h=release%2F13.1.0'/>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src/'/>
<updated>2021-09-25T08:34:39Z</updated>
<entry>
<title>diff: read whole files to determine if they are ASCII text</title>
<updated>2021-09-25T08:34:39Z</updated>
<author>
<name>Piotr Pawel Stefaniak</name>
<email>pstef@FreeBSD.org</email>
</author>
<published>2021-08-22T19:57:13Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src/commit/?id=bda949b6efdf099846775d3dc595c36561df1cca'/>
<id>urn:sha1:bda949b6efdf099846775d3dc595c36561df1cca</id>
<content type='text'>
Before this change, only the first BUFSIZE bytes were checked.

(cherry picked from commit 3cbf98e2bee91db9ed9118ff557e02cdd449f49a)
</content>
</entry>
<entry>
<title>diff: don't output carriage returns that were stripped on input</title>
<updated>2021-09-25T08:34:38Z</updated>
<author>
<name>Piotr Pawel Stefaniak</name>
<email>pstef@FreeBSD.org</email>
</author>
<published>2021-08-22T16:05:59Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src/commit/?id=ece58f7ada409ac68e072cdddcc29e21127aafce'/>
<id>urn:sha1:ece58f7ada409ac68e072cdddcc29e21127aafce</id>
<content type='text'>
--strip-trailing-cr worked as intended for comparison between files,
but the characters were still present in final output.

(cherry picked from commit af2f0164318455433db95adce07af829285b78ad)
</content>
</entry>
<entry>
<title>usr.bin/diff: fix UBSan error in readhash</title>
<updated>2021-08-05T08:59:26Z</updated>
<author>
<name>Alex Richardson</name>
<email>arichardson@FreeBSD.org</email>
</author>
<published>2021-07-06T11:16:40Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src/commit/?id=7a7324d9cebee6f42d77a39f3a8c657e23676cc2'/>
<id>urn:sha1:7a7324d9cebee6f42d77a39f3a8c657e23676cc2</id>
<content type='text'>
UBSan complains about the `sum = sum * 127 + chrtran(t);` line below since
that can overflow an `int`. Use `unsigned int` instead to ensure that
overflow is well-defined.

Reviewed By:	imp
MFC after:	1 week
Differential Revision: https://reviews.freebsd.org/D31075

(cherry picked from commit c78f449d85e0b292fe5d942cca99f11c1cd430fa)
</content>
</entry>
<entry>
<title>diff: eleminitate useless macros</title>
<updated>2021-05-05T08:37:09Z</updated>
<author>
<name>Baptiste Daroussin</name>
<email>bapt@FreeBSD.org</email>
</author>
<published>2021-01-27T10:47:17Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src/commit/?id=7904a2e5a8c56853bd39f5fe22a14cf8b526cd3c'/>
<id>urn:sha1:7904a2e5a8c56853bd39f5fe22a14cf8b526cd3c</id>
<content type='text'>
The diff_output was not bringing any values but was obfuscating
the code.

(cherry picked from commit 7a57c9cb5a4dffb0483beeae6da7cf266ea634be)
</content>
</entry>
<entry>
<title>diff: simplify the hash functions</title>
<updated>2021-05-05T08:37:09Z</updated>
<author>
<name>Baptiste Daroussin</name>
<email>bapt@FreeBSD.org</email>
</author>
<published>2021-01-26T15:25:00Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src/commit/?id=b6b26cecc0babc7834c026b43bb761cbd5147ed9'/>
<id>urn:sha1:b6b26cecc0babc7834c026b43bb761cbd5147ed9</id>
<content type='text'>
Instead of 3 different complex case they have all been folded into a
simple on based on switch

(cherry picked from commit e43239f5140e1b80de122458a2ac037172866058)
</content>
</entry>
<entry>
<title>diff: fix typo in a comment</title>
<updated>2021-05-05T08:37:09Z</updated>
<author>
<name>Baptiste Daroussin</name>
<email>bapt@FreeBSD.org</email>
</author>
<published>2021-01-26T14:20:44Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src/commit/?id=ffbf0225b7d2fbee1acd430eaf714b29f378bebf'/>
<id>urn:sha1:ffbf0225b7d2fbee1acd430eaf714b29f378bebf</id>
<content type='text'>
(cherry picked from commit e52546a3a75f6e4b327178f4d50a98dd99101c64)
</content>
</entry>
<entry>
<title>diff: eliminate space at end of line</title>
<updated>2021-05-05T08:37:08Z</updated>
<author>
<name>Baptiste Daroussin</name>
<email>bapt@FreeBSD.org</email>
</author>
<published>2021-01-27T10:46:15Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src/commit/?id=0ce985a23b505750faa446ebf7dae177bf3f88c4'/>
<id>urn:sha1:0ce985a23b505750faa446ebf7dae177bf3f88c4</id>
<content type='text'>
No functionnal changes

(cherry picked from commit 15abb23286541c17ff95bac056cd4979822c4288)
</content>
</entry>
<entry>
<title>diff: fix incorrectly displaying files as duplicates</title>
<updated>2021-02-01T13:05:25Z</updated>
<author>
<name>Jamie Landeg-Jones</name>
<email>jamie@catflap.org</email>
</author>
<published>2021-01-25T17:42:26Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src/commit/?id=3728c4d3149553967532a97254737bdb2cd92417'/>
<id>urn:sha1:3728c4d3149553967532a97254737bdb2cd92417</id>
<content type='text'>
When diff hits certain access errors, function diffreg() shows the error
message, and then returns to the calling function, which calls
print_status() with the return value.

However, in these cases, the return value isn't changed from the initial
default value of D_SAME.

Normally, print_status() with a value of D_SAME does nothing, so this
works out ok, however, if the "-s" flag is set, a message is displayed
showing identicality:

case D_SAME:
                if (sflag)
                        printf("Files %s%s and %s%s are identical\n",                                                                                                       path1, entry, path2, entry);
                break;

This then produces such results as:

% diff  -s /COPYRIGHT /var/run/rpcbind.sock
diff: /var/run/rpcbind.sock: Operation not supported
Files /COPYRIGHT and /var/run/rpcbind.sock are identical

% diff  -s /COPYRIGHT /etc/master.passwd
diff: /etc/master.passwd: Permission denied
Files /COPYRIGHT and /etc/master.passwd are identical

Create a D_ERROR status which is returned in such cases, and
print_status() then deals with that status seperately from D_SAME

PR:		252614
MFC after:	1 week

(cherry picked from commit fefb3c46a80fdde6f307e73a2b5b5aed806df1ce)
</content>
</entry>
<entry>
<title>diff: honour flags with -q</title>
<updated>2021-01-09T18:34:06Z</updated>
<author>
<name>Ed Maste</name>
<email>emaste@FreeBSD.org</email>
</author>
<published>2021-01-09T16:22:28Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src/commit/?id=12a8d3027d414abd15798de1b6d8b01151bdac50'/>
<id>urn:sha1:12a8d3027d414abd15798de1b6d8b01151bdac50</id>
<content type='text'>
Previously -q (just print a line when files differ) ignored flags like
-w (ignore whitespace).  Avoid the D_BRIEF short-circuit when flags are
in effect.

PR:		252515
Reported by:	Scott Aitken
Reviewed by:	kevans
MFC after:	1 week
Sponsored by:	The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D28064
</content>
</entry>
<entry>
<title>diff: always properly kill pr(1)</title>
<updated>2020-09-01T14:52:39Z</updated>
<author>
<name>Baptiste Daroussin</name>
<email>bapt@FreeBSD.org</email>
</author>
<published>2020-09-01T14:52:39Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src/commit/?id=fb0d1c6980b3f9f912c2582e4a9f343a3108c03b'/>
<id>urn:sha1:fb0d1c6980b3f9f912c2582e4a9f343a3108c03b</id>
<content type='text'>
When diff is invoked with -l it will spawn the pr(1) program.
In some circumpstances the pr(1) was not properly killed when diff program
exits.

Submitted by:	Bret Ketchum
MFC after:	3 days
Differential Revision:	https://reviews.freebsd.org/D26232
</content>
</entry>
</feed>
