OpenBSD CVS

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


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

Request diff between arbitrary revisions


Default branch: MAIN


Revision 1.21 / (download) - annotate - [select for diffs], Tue Apr 13 14:20:23 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.20: +3 -1 lines
Diff to previous 1.20 (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.20 / (download) - annotate - [select for diffs], Fri Jun 26 07:28:47 2020 UTC (3 years, 10 months ago) by stsp
Branch: MAIN
CVS Tags: OPENBSD_6_8_BASE, OPENBSD_6_8
Changes since 1.19: +9 -2 lines
Diff to previous 1.19 (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.19 / (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_7_BASE, OPENBSD_6_7, OPENBSD_6_6_BASE, OPENBSD_6_6, 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.18: +7 -2 lines
Diff to previous 1.18 (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.18 / (download) - annotate - [select for diffs], Sun Oct 16 13:03:40 2016 UTC (7 years, 7 months ago) by millert
Branch: MAIN
Changes since 1.17: +2 -2 lines
Diff to previous 1.17 (colored)

Remove useless n=n assignment in the first parse of a for().
It was already removed from the rcs version by nicm@.

Revision 1.17 / (download) - annotate - [select for diffs], Fri Oct 9 01:37:07 2015 UTC (8 years, 7 months ago) by deraadt
Branch: MAIN
CVS Tags: OPENBSD_6_0_BASE, OPENBSD_6_0, OPENBSD_5_9_BASE, OPENBSD_5_9
Changes since 1.16: +3 -3 lines
Diff to previous 1.16 (colored)

Change all tame callers to namechange to pledge(2).

Revision 1.16 / (download) - annotate - [select for diffs], Mon Oct 5 13:30:30 2015 UTC (8 years, 7 months ago) by deraadt
Branch: MAIN
Changes since 1.15: +4 -1 lines
Diff to previous 1.15 (colored)

tame "stdio rpath" or tame "stdio" suffices for all of these programs.
fairly easy to audit by running nm and noticing nothing beyond base
stdio except for fopen/freopen.  Then review all callpaths to those
functions, and place the tame() calls.
ok sthen

Revision 1.15 / (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.14: +2 -2 lines
Diff to previous 1.14 (colored)

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

ok deraadt@ looks correct millert@ jung@

Revision 1.14 / (download) - annotate - [select for diffs], Mon Dec 1 06:36:32 2014 UTC (9 years, 5 months ago) by deraadt
Branch: MAIN
CVS Tags: OPENBSD_5_8_BASE, OPENBSD_5_8, OPENBSD_5_7_BASE, OPENBSD_5_7
Changes since 1.13: +5 -5 lines
Diff to previous 1.13 (colored)

trivial reallocarray() use

Revision 1.13 / (download) - annotate - [select for diffs], Fri Nov 15 22:20:04 2013 UTC (10 years, 6 months ago) by millert
Branch: MAIN
CVS Tags: OPENBSD_5_6_BASE, OPENBSD_5_6, OPENBSD_5_5_BASE, OPENBSD_5_5
Changes since 1.12: +4 -3 lines
Diff to previous 1.12 (colored)

Include unistd.h as it is the standard location for getopt().

Revision 1.12 / (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_4_BASE, OPENBSD_5_4, OPENBSD_5_3_BASE, OPENBSD_5_3, OPENBSD_5_2_BASE, OPENBSD_5_2
Changes since 1.11: +5 -5 lines
Diff to previous 1.11 (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.11 / (download) - annotate - [select for diffs], Tue Oct 27 23:59:37 2009 UTC (14 years, 6 months ago) by deraadt
Branch: MAIN
CVS Tags: OPENBSD_5_1_BASE, OPENBSD_5_1, OPENBSD_5_0_BASE, OPENBSD_5_0, OPENBSD_4_9_BASE, OPENBSD_4_9, OPENBSD_4_8_BASE, OPENBSD_4_8, OPENBSD_4_7_BASE, OPENBSD_4_7
Changes since 1.10: +1 -11 lines
Diff to previous 1.10 (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.10 / (download) - annotate - [select for diffs], Wed Feb 27 18:10:05 2008 UTC (16 years, 2 months ago) by tobias
Branch: MAIN
CVS Tags: OPENBSD_4_6_BASE, OPENBSD_4_6, OPENBSD_4_5_BASE, OPENBSD_4_5, OPENBSD_4_4_BASE, OPENBSD_4_4, OPENBSD_4_3_BASE, OPENBSD_4_3
Changes since 1.9: +6 -6 lines
Diff to previous 1.9 (colored)

Properly check if temporary files have been successfully opened.  If not,
print error message on stderr (instead of stdout).

ok millert, ray, tedu

Revision 1.9 / (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.8: +4 -4 lines
Diff to previous 1.8 (colored)

Proper use of fseek/fseeko macros.

OK joris@, otto@

Revision 1.8 / (download) - annotate - [select for diffs], Tue Nov 22 16:00:49 2005 UTC (18 years, 6 months ago) by markus
Branch: MAIN
CVS Tags: OPENBSD_4_2_BASE, OPENBSD_4_2, OPENBSD_4_1_BASE, OPENBSD_4_1, OPENBSD_4_0_BASE, OPENBSD_4_0, OPENBSD_3_9_BASE, OPENBSD_3_9
Changes since 1.7: +6 -4 lines
Diff to previous 1.7 (colored)

out-of-bounds access; ok otto@, millert@, deraadt@

Revision 1.7 / (download) - annotate - [select for diffs], Mon Aug 1 08:17:57 2005 UTC (18 years, 9 months ago) by otto
Branch: MAIN
CVS Tags: OPENBSD_3_8_BASE, OPENBSD_3_8
Changes since 1.6: +57 -19 lines
Diff to previous 1.6 (colored)

Use dynamic memory instead of a fixed table. Makes merges files with
lots of changes possible. While there, kill an off-by-one.
Report and testing by Alexander Bluhm. ok millert@

Revision 1.6 / (download) - annotate - [select for diffs], Wed Mar 30 04:44:52 2005 UTC (19 years, 1 month ago) by millert
Branch: MAIN
Changes since 1.5: +43 -32 lines
Diff to previous 1.5 (colored)

Use fgetln() to read lines so we are not limited to an arbitrarily small
line length.  OK otto@

Revision 1.5 / (download) - annotate - [select for diffs], Wed Jan 7 18:16:42 2004 UTC (20 years, 4 months ago) by canacar
Branch: MAIN
CVS Tags: OPENBSD_3_7_BASE, OPENBSD_3_7, OPENBSD_3_6_BASE, OPENBSD_3_6, OPENBSD_3_5_BASE, OPENBSD_3_5
Changes since 1.4: +4 -4 lines
Diff to previous 1.4 (colored)

Correctly test for cases where one file is different, and the other has
no more changes.

ok millert@

Revision 1.4 / (download) - annotate - [select for diffs], Sun Nov 9 20:13:57 2003 UTC (20 years, 6 months ago) by otto
Branch: MAIN
Changes since 1.3: +5 -5 lines
Diff to previous 1.3 (colored)

Typos in comments from Jared Yanovich <jjy2+ at pitt dot edu>

Revision 1.3 / (download) - annotate - [select for diffs], Fri Oct 24 20:32:06 2003 UTC (20 years, 6 months ago) by avsm
Branch: MAIN
Changes since 1.2: +3 -3 lines
Diff to previous 1.2 (colored)

dont compare int to NULL, millert@ ok

Revision 1.2 / (download) - annotate - [select for diffs], Mon Jul 14 17:43:52 2003 UTC (20 years, 10 months ago) by deraadt
Branch: MAIN
CVS Tags: OPENBSD_3_4_BASE, OPENBSD_3_4
Changes since 1.1: +31 -31 lines
Diff to previous 1.1 (colored)

knf

Revision 1.1 / (download) - annotate - [select for diffs], Thu Jul 10 16:06:07 2003 UTC (20 years, 10 months ago) by millert
Branch: MAIN

A matching diff3 from 32V w/ some UCB changes.  I cleaned this up a bit
(KNF and -Wall) and rewrote the shell front-end.

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.