summaryrefslogtreecommitdiffstats
path: root/usr.bin/diff3/diff3prog.c (follow)
Commit message (Collapse)AuthorAgeFilesLines
* Fix merging of files that lack newlines for diff(3), OpenRCS, and OpenCVS.stsp2020-06-261-2/+9
| | | | | | | | | | | | | | | | | | | | | 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@
* Using bitwise OR along with two assignments in the conditional ofmillert2016-10-181-2/+7
| | | | | | 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@
* Remove useless n=n assignment in the first parse of a for().millert2016-10-161-2/+2
| | | | It was already removed from the rcs version by nicm@.
* Change all tame callers to namechange to pledge(2).deraadt2015-10-091-3/+3
|
* tame "stdio rpath" or tame "stdio" suffices for all of these programs.deraadt2015-10-051-1/+4
| | | | | | | 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
* Add brackets to clarify assignments that are the result of a test operator.jsg2015-09-051-2/+2
| | | | ok deraadt@ looks correct millert@ jung@
* trivial reallocarray() usederaadt2014-12-011-5/+5
|
* Include unistd.h as it is the standard location for getopt().millert2013-11-151-3/+4
|
* In preparation for getline and getdelim additions to libc, rename getline()fgsch2012-03-041-5/+5
| | | | | occurrences to get_line(). Based on a diff from Jan Klemkow <j-dot-klemkow-at-wemelug-dot-de> to tech.
* rcsid[] and sccsid[] and copyright[] are essentially unmaintained (andderaadt2009-10-271-11/+1
| | | | | | | 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
* Properly check if temporary files have been successfully opened. If not,tobias2008-02-271-6/+6
| | | | | | print error message on stderr (instead of stdout). ok millert, ray, tedu
* Proper use of fseek/fseeko macros.tobias2007-09-101-4/+4
| | | | OK joris@, otto@
* out-of-bounds access; ok otto@, millert@, deraadt@markus2005-11-221-4/+6
|
* Use dynamic memory instead of a fixed table. Makes merges files withotto2005-08-011-19/+57
| | | | | lots of changes possible. While there, kill an off-by-one. Report and testing by Alexander Bluhm. ok millert@
* Use fgetln() to read lines so we are not limited to an arbitrarily smallmillert2005-03-301-31/+42
| | | | line length. OK otto@
* Correctly test for cases where one file is different, and the other hascanacar2004-01-071-4/+4
| | | | | | no more changes. ok millert@
* Typos in comments from Jared Yanovich <jjy2+ at pitt dot edu>otto2003-11-091-5/+5
|
* dont compare int to NULL, millert@ okavsm2003-10-241-3/+3
|
* knfderaadt2003-07-141-31/+31
|
* A matching diff3 from 32V w/ some UCB changes. I cleaned this up a bitmillert2003-07-101-0/+566
(KNF and -Wall) and rewrote the shell front-end.