OpenBSD CVS

CVS log for src/usr.bin/rcs/diff3.c


[BACK] Up to [local] / src / usr.bin / rcs

Request diff between arbitrary revisions


Default branch: MAIN


Revision 1.45 / (download) - annotate - [select for diffs], Tue Apr 13 14:20:24 2021 UTC (3 years, 1 month ago) by stsp
Branch: MAIN
CVS Tags: OPENBSD_7_5_BASE, OPENBSD_7_5, OPENBSD_7_4_BASE, OPENBSD_7_4, OPENBSD_7_3_BASE, OPENBSD_7_3, OPENBSD_7_2_BASE, OPENBSD_7_2, OPENBSD_7_1_BASE, OPENBSD_7_1, OPENBSD_7_0_BASE, OPENBSD_7_0, OPENBSD_6_9_BASE, OPENBSD_6_9, HEAD
Changes since 1.44: +3 -1 lines
Diff to previous 1.44 (colored)

Fix merging of files that lack a final \n at EOF after a block of common lines.

Problem reported by Josh Rickmar.
ok millert@

Revision 1.44 / (download) - annotate - [select for diffs], Fri Jun 26 07:28:46 2020 UTC (3 years, 10 months ago) by stsp
Branch: MAIN
CVS Tags: OPENBSD_6_8_BASE, OPENBSD_6_8
Changes since 1.43: +10 -3 lines
Diff to previous 1.43 (colored)

Fix merging of files that lack newlines for diff(3), OpenRCS, and OpenCVS.

Merges with a file that lacks newlines (\n) were triggering a fatal error.
This could be easily reproduced with merge(1) and diff3(1):
$ echo foo > foo
$ echo bar > bar
$ echo -n baz > baz
$ merge -p foo bar baz
merge: failed to merge
$ diff3 -E foo bar baz
1a
=======
diff3prog: logic error
$

Fix this by properly handling short reads from the third file argument.
Only the third file argument triggered the problem. The other input
files were already handled correctly.

ok millert@

Revision 1.43 / (download) - annotate - [select for diffs], Sat Aug 10 16:39:33 2019 UTC (4 years, 9 months ago) by stsp
Branch: MAIN
CVS Tags: OPENBSD_6_7_BASE, OPENBSD_6_7, OPENBSD_6_6_BASE, OPENBSD_6_6
Changes since 1.42: +4 -2 lines
Diff to previous 1.42 (colored)

Amend previous fix; joris@ fixed the same bug in OpenCVS's diff3.c r1.47.
Put the OpenCVS fix, which additionally checks for trailing \n, into OpenRCS.
Sync requested by deraadt@ (thanks, I would otherwise have overlooked this)

Revision 1.42 / (download) - annotate - [select for diffs], Sat Aug 10 16:13:46 2019 UTC (4 years, 9 months ago) by stsp
Branch: MAIN
Changes since 1.41: +2 -2 lines
Diff to previous 1.41 (colored)

Fix merge(1) of files which contain lines with leading dots.

A check which tried to detect "dot on a line of its own" in the
internal ed script was treating any line with a leading dot as such.
Changes made to groups of such lines therefore ended up being
truncated in the merged result.

"For a random user, there's no shame in being unable to use ed."
	-- Michael W Lucas

ok millert@ deraadt@

Revision 1.41 / (download) - annotate - [select for diffs], Tue Oct 18 21:06:52 2016 UTC (7 years, 7 months ago) by millert
Branch: MAIN
CVS Tags: OPENBSD_6_5_BASE, OPENBSD_6_5, OPENBSD_6_4_BASE, OPENBSD_6_4, OPENBSD_6_3_BASE, OPENBSD_6_3, OPENBSD_6_2_BASE, OPENBSD_6_2, OPENBSD_6_1_BASE, OPENBSD_6_1
Changes since 1.40: +7 -2 lines
Diff to previous 1.40 (colored)

Using bitwise OR along with two assignments in the conditional of
a while() loop is a trap for the unwary programmer (albeit a clever
trap).  Break this up into two separate assignments and using boolean
OR for clarity.  OK otto@

Revision 1.40 / (download) - annotate - [select for diffs], Sun Oct 16 13:35:51 2016 UTC (7 years, 7 months ago) by okan
Branch: MAIN
Changes since 1.39: +2 -2 lines
Diff to previous 1.39 (colored)

Quiet compiler warnings; as applied to usr.bin/cvs by millert@

ok millert@

Revision 1.39 / (download) - annotate - [select for diffs], Fri Aug 26 09:02:54 2016 UTC (7 years, 8 months ago) by guenther
Branch: MAIN
Changes since 1.38: +2 -1 lines
Diff to previous 1.38 (colored)

Pull in <time.h> for struct tm, used in rcs.h

ok deraadt@

Revision 1.38 / (download) - annotate - [select for diffs], Mon Nov 2 16:45:21 2015 UTC (8 years, 6 months ago) by nicm
Branch: MAIN
CVS Tags: OPENBSD_6_0_BASE, OPENBSD_6_0, OPENBSD_5_9_BASE, OPENBSD_5_9
Changes since 1.37: +9 -17 lines
Diff to previous 1.37 (colored)

Allow rcsnum_free and buf_free to accept NULL and remove various NULL
checks that are now unnecessary, from Michael W Bombardieri. ok millert

Revision 1.37 / (download) - annotate - [select for diffs], Sat Sep 5 09:47:08 2015 UTC (8 years, 8 months ago) by jsg
Branch: MAIN
Changes since 1.36: +2 -2 lines
Diff to previous 1.36 (colored)

Add brackets to clarify assignments that are the result of a test operator.

ok deraadt@ looks correct millert@ jung@

Revision 1.36 / (download) - annotate - [select for diffs], Sat Jun 13 20:15:21 2015 UTC (8 years, 11 months ago) by nicm
Branch: MAIN
CVS Tags: OPENBSD_5_8_BASE, OPENBSD_5_8
Changes since 1.35: +15 -29 lines
Diff to previous 1.35 (colored)

Convert xfree to free. From Fritjof Bornebusch. ok deraadt

Revision 1.35 / (download) - annotate - [select for diffs], Fri Jan 16 06:40:11 2015 UTC (9 years, 4 months ago) by deraadt
Branch: MAIN
CVS Tags: OPENBSD_5_7_BASE, OPENBSD_5_7
Changes since 1.34: +2 -2 lines
Diff to previous 1.34 (colored)

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)

Revision 1.34 / (download) - annotate - [select for diffs], Mon Dec 1 21:58:46 2014 UTC (9 years, 5 months ago) by deraadt
Branch: MAIN
Changes since 1.33: +6 -6 lines
Diff to previous 1.33 (colored)

An internal function called xrealloc() is actually a fail-hard
reallocarray()... so rename it.

Revision 1.33 / (download) - annotate - [select for diffs], Sun Mar 4 04:05:15 2012 UTC (12 years, 2 months ago) by fgsch
Branch: MAIN
CVS Tags: OPENBSD_5_6_BASE, OPENBSD_5_6, OPENBSD_5_5_BASE, OPENBSD_5_5, OPENBSD_5_4_BASE, OPENBSD_5_4, OPENBSD_5_3_BASE, OPENBSD_5_3, OPENBSD_5_2_BASE, OPENBSD_5_2
Changes since 1.32: +5 -5 lines
Diff to previous 1.32 (colored)

In preparation for getline and getdelim additions to libc, rename getline()
occurrences to get_line().
Based on a diff from Jan Klemkow <j-dot-klemkow-at-wemelug-dot-de> to tech.

Revision 1.32 / (download) - annotate - [select for diffs], Wed Apr 20 19:34:16 2011 UTC (13 years, 1 month ago) by nicm
Branch: MAIN
CVS Tags: OPENBSD_5_1_BASE, OPENBSD_5_1, OPENBSD_5_0_BASE, OPENBSD_5_0
Changes since 1.31: +2 -2 lines
Diff to previous 1.31 (colored)

Remove some unneeded includes and dead code, from Michael W Bombardieri.

ok jasper xsa

Revision 1.31 / (download) - annotate - [select for diffs], Wed Jul 28 09:07:11 2010 UTC (13 years, 9 months ago) by ray
Branch: MAIN
CVS Tags: OPENBSD_4_9_BASE, OPENBSD_4_9, OPENBSD_4_8_BASE, OPENBSD_4_8
Changes since 1.30: +11 -11 lines
Diff to previous 1.30 (colored)

Make BUFs autoextend by default.  This was already done in OpenCVS
a while ago.

OK zinovik nicm

Revision 1.30 / (download) - annotate - [select for diffs], Fri Jul 23 21:46:05 2010 UTC (13 years, 9 months ago) by ray
Branch: MAIN
Changes since 1.29: +54 -50 lines
Diff to previous 1.29 (colored)

Reduce variable/function name and whitespace differences between
cvs/rcs.

OK xsa zinovik

Revision 1.29 / (download) - annotate - [select for diffs], Fri Jul 23 08:31:19 2010 UTC (13 years, 10 months ago) by ray
Branch: MAIN
Changes since 1.28: +3 -3 lines
Diff to previous 1.28 (colored)

Rename a bunch of variables and functions, removing the cvs_/rcs_
prefixes to reduce differences between cvs and rcs files.

"yes!" nicm

Revision 1.28 / (download) - annotate - [select for diffs], Tue Oct 27 23:59:42 2009 UTC (14 years, 6 months ago) by deraadt
Branch: MAIN
CVS Tags: OPENBSD_4_7_BASE, OPENBSD_4_7
Changes since 1.27: +1 -12 lines
Diff to previous 1.27 (colored)

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

Revision 1.27 / (download) - annotate - [select for diffs], Wed Feb 25 23:16:20 2009 UTC (15 years, 2 months ago) by ray
Branch: MAIN
CVS Tags: OPENBSD_4_6_BASE, OPENBSD_4_6, OPENBSD_4_5_BASE, OPENBSD_4_5
Changes since 1.26: +6 -6 lines
Diff to previous 1.26 (colored)

Checking if a file is ASCII should only be done when diffing, because
the non-ASCII characters could be printed to the screen.  For
checking in files, checking out files, merging files, and removing
revisions of files, we do so regardless of whether the files are
ASCII or binary.

Fixes PR6031.

OK joris and deraadt.

Revision 1.26 / (download) - annotate - [select for diffs], Sun Mar 2 19:40:58 2008 UTC (16 years, 2 months ago) by tobias
Branch: MAIN
CVS Tags: OPENBSD_4_4_BASE, OPENBSD_4_4, OPENBSD_4_3_BASE, OPENBSD_4_3
Changes since 1.25: +15 -7 lines
Diff to previous 1.25 (colored)

Make sure that temporary file has been successfully opened.

ok joris

Revision 1.25 / (download) - annotate - [select for diffs], Sun Dec 23 01:15:12 2007 UTC (16 years, 5 months ago) by tedu
Branch: MAIN
Changes since 1.24: +3 -3 lines
Diff to previous 1.24 (colored)

increase the marker buffers, they are not big enough for hg merge

Revision 1.24 / (download) - annotate - [select for diffs], Mon Sep 10 14:29:53 2007 UTC (16 years, 8 months ago) by tobias
Branch: MAIN
Changes since 1.23: +4 -4 lines
Diff to previous 1.23 (colored)

Proper use of fseek/fseeko macros.

OK joris@, otto@

Revision 1.23 / (download) - annotate - [select for diffs], Tue Jul 3 00:56:23 2007 UTC (16 years, 10 months ago) by ray
Branch: MAIN
CVS Tags: OPENBSD_4_2_BASE, OPENBSD_4_2
Changes since 1.22: +6 -6 lines
Diff to previous 1.22 (colored)

Rename rcs_diffreg() to diffreg().

OK joris@

Revision 1.22 / (download) - annotate - [select for diffs], Sat Jun 30 08:23:49 2007 UTC (16 years, 10 months ago) by xsa
Branch: MAIN
Changes since 1.21: +3 -3 lines
Diff to previous 1.21 (colored)

Sync revisions and time buffers size to be consistent with each others.
Simplifies further size tweaks if needed.
OK ray@.

Revision 1.21 / (download) - annotate - [select for diffs], Tue May 29 00:19:10 2007 UTC (16 years, 11 months ago) by ray
Branch: MAIN
Changes since 1.20: +11 -19 lines
Diff to previous 1.20 (colored)

Since xrealloc dies on failure it is safe to directly assign to the
original pointer.  Theo agrees, and so does the rest of the tree
(ssh, etc. all do this already).

Saves a bunch of variables and assignments.

OK niallo@

Revision 1.20 / (download) - annotate - [select for diffs], Tue Feb 27 07:59:13 2007 UTC (17 years, 2 months ago) by xsa
Branch: MAIN
CVS Tags: OPENBSD_4_1_BASE, OPENBSD_4_1
Changes since 1.19: +8 -3 lines
Diff to previous 1.19 (colored)

As done in OpenCVS, general includes cleanup sweep. OK otto@.

Revision 1.19 / (download) - annotate - [select for diffs], Thu Feb 22 08:30:45 2007 UTC (17 years, 3 months ago) by xsa
Branch: MAIN
Changes since 1.18: +4 -4 lines
Diff to previous 1.18 (colored)

Fix const inconsistencies, void pointer artithmetic;
Based on diff from otto@ in OpenCVS. OK otto@.

Revision 1.18 / (download) - annotate - [select for diffs], Thu Jan 11 18:13:33 2007 UTC (17 years, 4 months ago) by niallo
Branch: MAIN
Changes since 1.17: +2 -9 lines
Diff to previous 1.17 (colored)

remove some un-needed buffer NUL-termination.  in openrcs, diff3 is already NUL-terminating its
buffers so we don't need to do it twice.  this allows us to sync rcs_splitlines() with opencvs'
cvs_splitlines().

ok joris@

Revision 1.17 / (download) - annotate - [select for diffs], Tue Jan 2 16:43:45 2007 UTC (17 years, 4 months ago) by niallo
Branch: MAIN
Changes since 1.16: +41 -8 lines
Diff to previous 1.16 (colored)

- fix support for checking out binary files.

testing from xsa@ and Igor Sobrado <igor at string1.ciencias.uniovi.es>
ok xsa@

Revision 1.16 / (download) - annotate - [select for diffs], Tue Oct 24 06:22:53 2006 UTC (17 years, 6 months ago) by ray
Branch: MAIN
Changes since 1.15: +4 -2 lines
Diff to previous 1.15 (colored)

Check that string length != 0 before setting buf[strlen(buf) - 1].

OK xsa@.

Revision 1.15 / (download) - annotate - [select for diffs], Thu Sep 21 15:30:07 2006 UTC (17 years, 8 months ago) by millert
Branch: MAIN
Changes since 1.14: +6 -6 lines
Diff to previous 1.14 (colored)

Add support to rcsdiff for all the other diff flags that
are pertinent to files (not directories) and that do not
conflict with rcsdiff-specific flags.  OK xsa@

Revision 1.14 / (download) - annotate - [select for diffs], Fri Aug 11 08:18:19 2006 UTC (17 years, 9 months ago) by xsa
Branch: MAIN
CVS Tags: OPENBSD_4_0_BASE, OPENBSD_4_0
Changes since 1.13: +23 -19 lines
Diff to previous 1.13 (colored)

correctly handle merge(1) and rcsmerge(1) -e and -E flags; tests and OK ray@.

Revision 1.13 / (download) - annotate - [select for diffs], Tue Aug 8 10:22:01 2006 UTC (17 years, 9 months ago) by espie
Branch: MAIN
Changes since 1.12: +5 -4 lines
Diff to previous 1.12 (colored)

let ed_patch_lines work with a c command that encompasses the last line
of the file. The TAILQ structures specifically contain an extra `first line'
to avoid this kind of issue, but no extra last line.
Instead of walking beyond the end of the structure, and wondering at the
null pointer, keep a pointer before the deleted block, as this one is
guaranteed to exist.

Fix Matthieu's testcase.

okay joris@, xsa@

Revision 1.12 / (download) - annotate - [select for diffs], Mon Aug 7 20:55:28 2006 UTC (17 years, 9 months ago) by ray
Branch: MAIN
Changes since 1.11: +7 -7 lines
Diff to previous 1.11 (colored)

More strlcpy/strlcat -> snprintf/xasprintf cleanup.

OK joris@

Revision 1.11 / (download) - annotate - [select for diffs], Sat Jul 8 09:25:44 2006 UTC (17 years, 10 months ago) by ray
Branch: MAIN
Changes since 1.10: +12 -12 lines
Diff to previous 1.10 (colored)

Remove file mode argument from {cvs|rcs}_buf_write_stmp().  We
always set the temporary file to mode 600, which is already done
by mkstemp().

OK joris@ and xsa@ over a month ago.

Revision 1.10 / (download) - annotate - [select for diffs], Sat Jun 3 03:05:10 2006 UTC (17 years, 11 months ago) by niallo
Branch: MAIN
Changes since 1.9: +4 -23 lines
Diff to previous 1.9 (colored)

- correctly handle binary files; say bye bye to using c strings for deltatexts.

"slap it in" joris@

Revision 1.9 / (download) - annotate - [select for diffs], Mon May 15 06:58:03 2006 UTC (18 years ago) by xsa
Branch: MAIN
Changes since 1.8: +119 -2 lines
Diff to previous 1.8 (colored)

missing bits for a working merge(1). Built and enabled.
OK joris@ ray@.

Revision 1.8 / (download) - annotate - [select for diffs], Wed May 10 01:10:23 2006 UTC (18 years ago) by ray
Branch: MAIN
Changes since 1.7: +6 -6 lines
Diff to previous 1.7 (colored)

Remove (size_t) casts on integer constants.

We should not cover up lint's shortcomings, especially if they no
longer exist.

``This is definately good.'' niallo@.

Revision 1.7 / (download) - annotate - [select for diffs], Mon May 8 16:56:40 2006 UTC (18 years ago) by xsa
Branch: MAIN
Changes since 1.6: +9 -4 lines
Diff to previous 1.6 (colored)

check for rcs_diffreg() return value; OK ray@.

Revision 1.6 / (download) - annotate - [select for diffs], Mon May 8 10:19:34 2006 UTC (18 years ago) by xsa
Branch: MAIN
Changes since 1.5: +6 -9 lines
Diff to previous 1.5 (colored)

fix error/verbose messages to match gnu/usr.bin/rcs when using rcsmerge(1).

Revision 1.5 / (download) - annotate - [select for diffs], Thu May 4 07:06:58 2006 UTC (18 years ago) by xsa
Branch: MAIN
Changes since 1.4: +19 -23 lines
Diff to previous 1.4 (colored)

finish work wrt TMPDIR; use xasprintf() to simplify code while in there;
"looks fine" ray@.

Revision 1.4 / (download) - annotate - [select for diffs], Wed May 3 07:10:39 2006 UTC (18 years ago) by xsa
Branch: MAIN
Changes since 1.3: +19 -9 lines
Diff to previous 1.3 (colored)

respect TMPDIR; OK ray@.

Revision 1.3 / (download) - annotate - [select for diffs], Sat Apr 29 05:31:28 2006 UTC (18 years ago) by ray
Branch: MAIN
Changes since 1.2: +19 -16 lines
Diff to previous 1.2 (colored)

Check return values for all strlcpy, and strlcat calls.

OK xsa@ and probably others.

Revision 1.2 / (download) - annotate - [select for diffs], Thu Apr 27 07:59:33 2006 UTC (18 years ago) by xsa
Branch: MAIN
Changes since 1.1: +3 -3 lines
Diff to previous 1.1 (colored)

zap util.[ch] and move the content into rcsutil.[ch].
discussed with joris@.

Revision 1.1 / (download) - annotate - [select for diffs], Wed Apr 26 02:55:13 2006 UTC (18 years ago) by joris
Branch: MAIN

fork our code we shared between openrcs/cvs into the openrcs dir.

this was starting to become inhuman to maintain without
ugly ugly hacks in the shared code, and it will be easier
to make specific changes for openrcs without touching the
soon-to-be-replaced opencvs code.

This form allows you to request diff's between any two revisions of a file. You may select a symbolic revision name using the selection box or you may type in a numeric name using the type-in text box.