History log of /openbsd-src/usr.bin/diff/diffreg.c (Results 1 – 25 of 95)
Revision Date Author Comments
# b7041c07 24-Oct-2021 deraadt <deraadt@openbsd.org>

For open/openat, if the flags parameter does not contain O_CREAT, the
3rd (variadic) mode_t parameter is irrelevant. Many developers in the past
have passed mode_t (0, 044, 0644, or such), which mig

For open/openat, if the flags parameter does not contain O_CREAT, the
3rd (variadic) mode_t parameter is irrelevant. Many developers in the past
have passed mode_t (0, 044, 0644, or such), which might lead future people
to copy this broken idiom, and perhaps even believe this parameter has some
meaning or implication or application. Delete them all.
This comes out of a conversation where tb@ noticed that a strange (but
intentional) pledge behaviour is to always knock-out high-bits from
mode_t on a number of system calls as a safety factor, and his bewilderment
that this appeared to be happening against valid modes (at least visually),
but no sorry, they are all irrelevant junk. They could all be 0xdeafbeef.
ok millert

show more ...


# a05fc07d 01-Sep-2021 halex <halex@openbsd.org>

consider two files sharing the same inode identical

This gives a substantial speedup when comparing directory
structures with many hardlinked files, e.g. when using
rsnapshot for incremental backup.

consider two files sharing the same inode identical

This gives a substantial speedup when comparing directory
structures with many hardlinked files, e.g. when using
rsnapshot for incremental backup.

ok stsp@ millert@

show more ...


# 3aaa63eb 28-Jun-2019 deraadt <deraadt@openbsd.org>

When system calls indicate an error they return -1, not some arbitrary
value < 0. errno is only updated in this case. Change all (most?)
callers of syscalls to follow this better, and let's see if

When system calls indicate an error they return -1, not some arbitrary
value < 0. errno is only updated in this case. Change all (most?)
callers of syscalls to follow this better, and let's see if this strictness
helps us in the future.

show more ...


# c2d43eca 28-Jun-2019 deraadt <deraadt@openbsd.org>

mkstemp() returns -1 on failure


# d1e24f31 01-Mar-2016 natano <natano@openbsd.org>

Rectify line numbers for s/.// commands in ed-style diffs.

When diff encounters a line that consists of a single dot, it emits two
dots instead, stops the current command and emits a substitute comm

Rectify line numbers for s/.// commands in ed-style diffs.

When diff encounters a line that consists of a single dot, it emits two
dots instead, stops the current command and emits a substitute command
to replace the double dot with a single one. Then it restarts the
(original) command if necessary and inserts further lines. This is done
because a single dot on a line does have special meaning in ed. (It
stops text insertion.)

Following issues are fixed by this commit.

- The line number for the substitute command should be the number of the
most recently inserted line. diff instead uses the number of the first
inserted line of the current hunk. The first character of that line is
removed when applying the diff, while the superfluous dot is not.

- The line number of the restarted command is not adjusted for the
number of lines already inserted, resulting in the reordering of lines..

- When there is a bare dot in the replacement text of a change command,
too many lines are deleted, because a second change command is emitted.
An append command should be emitted instead, because the target lines
have already been removed by the first change command.

tweaks and ok stefan@

show more ...


# 4c413bf6 26-Oct-2015 tedu <tedu@openbsd.org>

remove TMPDIR support. ok millert


# e5826585 13-Oct-2015 tobias <tobias@openbsd.org>

Replace our /^\.\././ expression with /.//. The term is simpler and has
the same meaning in our diff ed-context.

As a bonus, our ed-diff output can be processed by GNU patch now, too.

okay millert@


# 40e7295b 05-Oct-2015 millert <millert@openbsd.org>

Remove the non-standard -l flag that pipes the output through pr(1).
Based on a diff from and OK deraadt@


# a79a2617 25-Sep-2015 tedu <tedu@openbsd.org>

xmalloc/free wrappers don't need to support 20 year old non comformance


# 371275ca 29-Apr-2015 deraadt <deraadt@openbsd.org>

Change internal xrealloc() to a idiom-following xreallocarray().
This loses a "new size is 0" failure case. Probably not relevant;
and since we develop this in OpenBSD, we'll catch that before someo

Change internal xrealloc() to a idiom-following xreallocarray().
This loses a "new size is 0" failure case. Probably not relevant;
and since we develop this in OpenBSD, we'll catch that before someone
else imports this...
ok millert

show more ...


# 1357284a 05-Feb-2015 millert <millert@openbsd.org>

Include stdint.h, not limits.h to get SIZE_MAX. OK guenther@


# b9fc9a72 16-Jan-2015 deraadt <deraadt@openbsd.org>

Replace <sys/param.h> with <limits.h> and other less dirty headers where
possible. Annotate <sys/param.h> lines with their current reasons. Switch
to PATH_MAX, NGROUPS_MAX, HOST_NAME_MAX+1, LOGIN_N

Replace <sys/param.h> with <limits.h> and other less dirty headers where
possible. Annotate <sys/param.h> lines with their current reasons. Switch
to PATH_MAX, NGROUPS_MAX, HOST_NAME_MAX+1, LOGIN_NAME_MAX, etc. Change
MIN() and MAX() to local definitions of MINIMUM() and MAXIMUM() where
sensible to avoid pulling in the pollution. These are the files confirmed
through binary verification.
ok guenther, millert, doug (helped with the verification protocol)

show more ...


# 82328041 27-Aug-2014 kspillner <kspillner@openbsd.org>

Ensure diff -uw always produces valid output when one file doesn't end
with a newline. Issue reported by guenther@.

ok guenther@


# 0631431f 08-Jul-2012 stsp <stsp@openbsd.org>

Switch diff(1) binary file detection from !(isprint() || isspace()) to
checking for embedded NULs, as was done for grep(1) some time ago.
Avoids problems with e.g. latin1-encoded files being treated

Switch diff(1) binary file detection from !(isprint() || isspace()) to
checking for embedded NULs, as was done for grep(1) some time ago.
Avoids problems with e.g. latin1-encoded files being treated as binary, since
isprint() uses only ASCII by default and diff(1) doesn't call setlocale().
prodded by and ok bluhm

show more ...


# 78245330 22-May-2012 millert <millert@openbsd.org>

Strip trailing slashes from directory in splice() before
appending the file portion. OK krw@ matthew@


# df890a16 01-Apr-2011 nicm <nicm@openbsd.org>

Move an isqrt() call outside a macro, from Michael W Bombardieri.

ok ray


# f481a864 16-Jul-2010 ray <ray@openbsd.org>

Close FILEs when fork fails.

OK nicm


# 60b54a0e 16-Jul-2010 ray <ray@openbsd.org>

diff exits 2 on error, not 1.

OK millert


# 5e07282d 15-Jul-2010 ray <ray@openbsd.org>

cvs and rcs use diff_output() to print everything since it is not
always to stdout. A large number of differences are due to this.
This diff reduces many more differences between diff and cvs/rcs.
Pe

cvs and rcs use diff_output() to print everything since it is not
always to stdout. A large number of differences are due to this.
This diff reduces many more differences between diff and cvs/rcs.
Personally I think it's kinda ugly. =(

"Looks fine" millert

show more ...


# 6fc40dae 15-Jul-2010 ray <ray@openbsd.org>

Remove unused arguments from check(). From cvs/rcs.

OK millert


# bdcce04d 14-Jul-2010 ray <ray@openbsd.org>

Return -1 on error as advertised.
Handle case when only one stream failed.

OK otto, millert


# b5188ac1 22-Mar-2010 schwarze <schwarze@openbsd.org>

Even though this cannot happen in the diff -r case,
even though diff(1) will exit(3) soon after this mkstemp(3) failure,
even though this cannot really leak anything,
close the file descriptor as soo

Even though this cannot happen in the diff -r case,
even though diff(1) will exit(3) soon after this mkstemp(3) failure,
even though this cannot really leak anything,
close the file descriptor as soon as it is not used any more
to make correctness of the code more obvious.

patch from Igor Zinovik <zinovik dot igor at gmail dot com> on tech@
"looks nice" deraadt@

show more ...


# 043fbe51 27-Oct-2009 deraadt <deraadt@openbsd.org>

rcsid[] and sccsid[] and copyright[] are essentially unmaintained (and
unmaintainable). these days, people use source. these id's do not provide
any benefit, and do hurt the small install media
(th

rcsid[] and sccsid[] and copyright[] are essentially unmaintained (and
unmaintainable). these days, people use source. these id's do not provide
any benefit, and do hurt the small install media
(the 33,000 line diff is essentially mechanical)
ok with the idea millert, ok dms

show more ...


# 57003866 07-Jun-2009 ray <ray@openbsd.org>

More cvs/diff/rcs convergence:
1. Mostly variable/function renaming, SIZE_T_MAX->SIZE_MAX, and
spacing.
2. One strchr -> strncspn.
3. diff had a weird thing where it set file[12] = ofile[12] but
neve

More cvs/diff/rcs convergence:
1. Mostly variable/function renaming, SIZE_T_MAX->SIZE_MAX, and
spacing.
2. One strchr -> strncspn.
3. diff had a weird thing where it set file[12] = ofile[12] but
never updated file or ofile, then if file and ofile were different
it freed it. I removed it.

OK millert

show more ...


# dba1d6ea 06-Jun-2009 ray <ray@openbsd.org>

Pull changes from rcsdiff, similar to what was pulled into cvsdiff.

OK millert


1234