History log of /freebsd/usr.bin/diff/diffreg.c (Results 26 – 50 of 71)
Revision (<<< Hide revision tags) (Show revision tags >>>) Date Author Comments
# c78f449d 06-Jul-2021 Alex Richardson <arichardson@FreeBSD.org>

usr.bin/diff: fix UBSan error in readhash

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

usr.bin/diff: fix UBSan error in readhash

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

show more ...


Revision tags: release/13.0.0
# c69047ca 02-Feb-2021 Baptiste Daroussin <bapt@FreeBSD.org>

Revert "diff: eliminate a useless lseek"

This changes breaks when one of the files is stdin

This reverts commit fa977a3b2bb2d0e6c2957b14474c31b58dd3a8e1.

Reported by: olivier


# 7a57c9cb 27-Jan-2021 Baptiste Daroussin <bapt@FreeBSD.org>

diff: eleminitate useless macros

The diff_output was not bringing any values but was obfuscating
the code.


# e43239f5 26-Jan-2021 Baptiste Daroussin <bapt@FreeBSD.org>

diff: simplify the hash functions

Instead of 3 different complex case they have all been folded into a
simple on based on switch


# e52546a3 26-Jan-2021 Baptiste Daroussin <bapt@FreeBSD.org>

diff: fix typo in a comment


# 15abb232 27-Jan-2021 Baptiste Daroussin <bapt@FreeBSD.org>

diff: eliminate space at end of line

No functionnal changes


# fa977a3b 26-Jan-2021 Baptiste Daroussin <bapt@FreeBSD.org>

diff: eliminate a useless lseek

fdopen with the "r" already position the stream at the beginning
of the file.


# fefb3c46 25-Jan-2021 Jamie Landeg-Jones <jamie@catflap.org>

diff: fix incorrectly displaying files as duplicates

When diff hits certain access errors, function diffreg() shows the error
message, and then returns to the calling function, which calls
print_sta

diff: fix incorrectly displaying files as duplicates

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

show more ...


# 12a8d302 09-Jan-2021 Ed Maste <emaste@FreeBSD.org>

diff: honour flags with -q

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
Repo

diff: honour flags with -q

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

show more ...


Revision tags: release/12.2.0
# fb0d1c69 01-Sep-2020 Baptiste Daroussin <bapt@FreeBSD.org>

diff: always properly kill pr(1)

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 K

diff: always properly kill pr(1)

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

show more ...


Revision tags: release/11.4.0
# bc02c18c 07-Feb-2020 Dimitry Andric <dim@FreeBSD.org>

Merge ^/head r357408 through r357661.


# 64793e74 07-Feb-2020 Baptiste Daroussin <bapt@FreeBSD.org>

diff: implement -y (--side-by-side) along with -W and --suppress-common-lines

PR: 219933
Submitted by: fehmi noyan isi <fnoyanisi@yahoo.com>
MFC after: 3 weeks


# 7dddaa09 14-Jan-2020 Mark Johnston <markj@FreeBSD.org>

Do not skip line-by-line comparison if -q and -I are specified.

This fixes a regression from r356695.

Submitted by: kevans
Reported by: Jenkins via lwhsu
MFC after: 6 days


# 12d9c0dc 14-Jan-2020 Baptiste Daroussin <bapt@FreeBSD.org>

When system calls indicate an error they return -1, not some arbitrary
value < 0. errno is only updated in this case.

Obtained from: OpenBSD
MFC after: 3 days


# a3337141 14-Jan-2020 Baptiste Daroussin <bapt@FreeBSD.org>

mkstemp returns -1

Obtained from: OpenBSD
MFC after: 3 days


# 5248d3b1 13-Jan-2020 Mark Johnston <markj@FreeBSD.org>

Optimize diff -q.

Once we know whether the files differ, we don't need to do any further
work.

PR: 242828
Submitted by: fehmi noyan isi <fnoyanisi@yahoo.com> (original version)
Reviewed by: bapt,

Optimize diff -q.

Once we know whether the files differ, we don't need to do any further
work.

PR: 242828
Submitted by: fehmi noyan isi <fnoyanisi@yahoo.com> (original version)
Reviewed by: bapt, kevans
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D23152

show more ...


Revision tags: release/12.1.0, release/11.3.0, release/12.0.0
# c06e7b66 07-Nov-2018 Dimitry Andric <dim@FreeBSD.org>

Merge ^/head r340126 through r340212.


# 377421df 04-Nov-2018 Mariusz Zaborski <oshogbo@FreeBSD.org>

capsicum: use a new capsicum helpers in tools

Use caph_{rights,ioctls,fcntls}_limit to simplify the code.


# 7847e041 24-Aug-2018 Dimitry Andric <dim@FreeBSD.org>

Merge ^/head r338026 through r338297, and resolve conflicts.


# 9488de00 19-Aug-2018 Kyle Evans <kevans@FreeBSD.org>

diff(1): Refactor -B a little bit

Instead of doing a second pass to skip empty lines if we've specified -I, go
ahead and check both at once. Ignore critera has been split out into its own
function t

diff(1): Refactor -B a little bit

Instead of doing a second pass to skip empty lines if we've specified -I, go
ahead and check both at once. Ignore critera has been split out into its own
function to try and keep the logic cleaner.

show more ...


# e68edb8c 19-Aug-2018 Kyle Evans <kevans@FreeBSD.org>

diff(1): Implement -B/--ignore-blank-lines

As noted by cem in r338035, coccinelle invokes diff(1) with the -B flag.
This was not previously implemented here, so one was forced to create a link
for G

diff(1): Implement -B/--ignore-blank-lines

As noted by cem in r338035, coccinelle invokes diff(1) with the -B flag.
This was not previously implemented here, so one was forced to create a link
for GNU diff to /usr/local/bin/diff

Implement the -B flag and add some primitive tests for it. It is implemented
in the same fashion that -I is implemented; each chunk's lines are scanned,
and if a non-blank line is encountered then the chunk will be output.
Otherwise, it's skipped.

MFC after: 2 weeks

show more ...


# 14b841d4 11-Aug-2018 Kyle Evans <kevans@FreeBSD.org>

MFH @ r337607, in preparation for boarding


# 9977c7b5 27-Jul-2018 Xin LI <delphij@FreeBSD.org>

Improve --strip-trailing-cr handling:

- Advance ctold for f1 and ctnew for f2
- ungetc() if the character is unexpected
- Don't break early when we hit the combination on one side

PR: 230049
Re

Improve --strip-trailing-cr handling:

- Advance ctold for f1 and ctnew for f2
- ungetc() if the character is unexpected
- Don't break early when we hit the combination on one side

PR: 230049
Reported by: maskray <emacsray gmail com>
Reviewed by: bapt, maskray
MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D16451

show more ...


Revision tags: release/11.2.0
# 7672a014 20-Jun-2018 Mariusz Zaborski <oshogbo@FreeBSD.org>

Convert `cap_enter() < 0 && errno != ENOSYS` to `caph_enter() < 0`.

No functional change intended.


# 6fa5bf08 09-Jun-2018 Baptiste Daroussin <bapt@FreeBSD.org>

Isolate the pr(1) related code in its own source files

This keeps diffreg.c closer to what it is supposed to do:
diffing regular files.

It also allows my code to get a proper license


123