summaryrefslogtreecommitdiffstats
path: root/usr.bin/diff/diff.c (follow)
Commit message (Collapse)AuthorAgeFilesLines
* Change all tame callers to namechange to pledge(2).deraadt2015-10-091-5/+5
|
* Remove the non-standard -l flag that pipes the output through pr(1).millert2015-10-051-28/+14
| | | | Based on a diff from and OK deraadt@
* use different tame requests if TMPDIR is in env:semarie2015-10-051-3/+8
| | | | | | | | | - tmppath for when mktemp() operates in /tmp proper - cpath+wpath for use of $TMPDIR based on log-message from previous commit ok deraadt@
* If the -l flag is set, diff will fork/execve pr on a pipe. But otherderaadt2015-10-051-1/+5
| | | | | | uses can tame "stdio wpath rpath cpath tmppath". tmppath for when mktemp() operates in /tmp proper, but cpath+wpath for use of $TMPDIR. ok sthen millert
* Change internal xrealloc() to a idiom-following xreallocarray().deraadt2015-04-291-2/+2
| | | | | | | 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
* Replace <sys/param.h> with <limits.h> and other less dirty headers wherederaadt2015-01-161-2/+2
| | | | | | | | | 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)
* Simplify print_status by removing NULL handling.ray2010-07-161-12/+10
| | | | OK nicm
* `-q' is an output option, hence it is mutually exclusive.sobrado2010-02-211-8/+8
| | | | ok jmc@
* move mutually exclusive options (-c, -e, -f, -n and -u) to the right place.sobrado2009-11-091-5/+5
| | | | ok jmc@
* rcsid[] and sccsid[] and copyright[] are essentially unmaintained (andderaadt2009-10-271-5/+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
* More cvs/diff/rcs convergence:ray2009-06-071-19/+19
| | | | | | | | | | | 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
* Oops, forgot to pass dflags to diffreg. Now the flags work again.ray2009-06-061-4/+4
| | | | OK millert
* Pull changes from rcsdiff, similar to what was pulled into cvsdiff.ray2009-06-061-13/+12
| | | | OK millert
* Bring in some changes from rcsdiff:ray2007-05-291-47/+10
| | | | | | | | | 1. Replace all the e*alloc functions with the x*alloc versions. 2. Whitespace syncs according to style. 3. Remove the __inline stuff. 4. Remove the min/max functions, using the MAX/MIN macros instead. OK millert@
* sort options/synopsis/usage();jmc2007-03-011-8/+7
| | | | from Igor Sobrado
* If the -L option is specified twice, use it for the second filenamemillert2004-12-091-4/+9
| | | | like GNU diff does. Adapted from a diff by YAMAMOTO Takashi
* advancing argv twice doesn't make it better.espie2004-12-071-3/+3
| | | | okay otto@.
* Implement -I option: ignore changes matching a set of regexes. Fromotto2004-06-201-10/+50
| | | | | Jared Yanovich, with twists from millert@ and me. Testing by brad@, sturm@ and pval@. ok millert@
* POSIX specifies that in directory mode device special files andmillert2004-03-161-2/+10
| | | | | | FIFOs shall be skipped. Other types of files may be skipped too (this is implementation-dependent). In directory mode, just skip anything that is not a regular file or directory. OK tedu@
* Implement -p option.otto2004-01-071-8/+12
| | | | "works here" millert@ ok miod@ deraadt@
* Fix printing of "Only in foo" when foo is "/" (trailing slash removalmillert2003-10-071-5/+11
| | | | was overzealous in this case). Fix tested by Hugo Villeneuve and myself.
* Make -number be an error (similar to my change in grep.c); OK tedu@millert2003-09-071-9/+15
|
* - add -P to SYNOPSISjmc2003-09-071-8/+8
| | | | | | | | | - remove "mutually exclusive" clause - -c produces 15 *'s, not a dozen - add -a to uage() - sync usage() with SYNOPSIS ok tedu@
* try again at -u#. ok deraadt@tedu2003-09-071-4/+15
|
* restore undocumented -u# support for the old schoolers. :)tedu2003-09-061-3/+3
| | | | noticed by itojun@, ok deraadt@
* fix spelling of --initial-tabdavid2003-08-181-3/+3
| | | | ok otto@
* cleanderaadt2003-07-291-4/+4
|
* Correct computation of argsize when setting diffargs.millert2003-07-271-4/+4
|
* - Use a heuristic to bound memory and cpu usage, at the cost ofotto2003-07-271-10/+14
| | | | | | | | | producing suboptimal diffs for large file containing lots of changes. Switch heuristic off with -d/--minimal (GNU compatible). Some hints from millert@. - Improve performance by reducing the number of realloc(3) calls. ok millert@ tedu@
* Add missing terminator to long options list.millert2003-07-221-2/+3
|
* Implement the -L and -T options from GNU diff.millert2003-07-221-11/+20
|
* Don't print a trailing '/' in foo when printing "Only in foo: bar"millert2003-07-211-3/+5
|
* Fix printing of status when not in -l mode which was broken when themillert2003-07-211-4/+4
| | | | -l support was added.
* a little KNFhenning2003-07-211-3/+3
|
* POSIX-compliant output when there are two paths w/ the same name butmillert2003-07-211-4/+8
| | | | one is a file and the other is a directory in -r mode (cosmetic).
* Unlink temp file as soon as it is opened and return a FILE * formillert2003-07-091-50/+26
| | | | | | | | | | | it so we don't have to worry about cleanup. This means the quit() signal handler and error/errorx can go away too. Move splice() out of diffreg() and into diff.c where it belongs since we don't want to be calling splice() for a directory diff. Add a check for mismatched paths (one file, one dir) in diffreg.c. deraadt@ OK
* Re-implement -l flag; diff -l now works correctly in non-directorymillert2003-07-091-7/+58
| | | | mode (like GNU diff).
* o Avoid a temp file if using stdin and stdin is redirected from a regular filemillert2003-07-081-4/+4
| | | | o Fix a double free in the temmp file case
* Add -q option from GNU diffmillert2003-07-061-8/+12
|
* Implement -P from GNU diff (like -N but only for files that are missingmillert2003-07-061-5/+9
| | | | from dir1).
* Some fairly major changes:millert2003-07-061-132/+183
| | | | | | | | | | | | | | | | | | | | | o -N is implemented o -X is implemented o -x is implemented o diff.c has been rewritten and GNU long options are now supported o diffdir.c has been rewritten + no longer does fork + exec of /usr/bin/diff + can be called recursively (and will be for -r) o diff.h + don't include any .h files here any more, do it in the .c files + no Bell Labs code in this, gets a UCB copyright (the 32v sources only have a diff.c and there is nothing in common). o diffreg.c + most all remaining globals are now private to diffreg.c + files are only opened once + dynamically allocated objects are either freed or realloced + added missing UCB copyright (there were lots of UCB changes) + print correct thing when -s is specified OK deraadt@
* Accept but ignore -h for backwards compat like GNU diff does.millert2003-07-041-4/+7
| | | | Pointed out by espie@. Also remove other references to -h mode.
* Kill non-standard -l option as discussed with tedu@millert2003-07-041-9/+5
|
* Kill diff -h, we don't use or want diffh. Discussed w/ tedu@millert2003-07-041-8/+2
|
* Some cosmetic fixes:millert2003-07-041-10/+4
| | | | | | | | o get rid of now-unused tempfile variable o move inifdef into diffreg.c (only used there) o correct a comment o use _PATH_DIFF, _PATH_DIFFH and _PATH_PR instead of variables set to them o get rid of hack to look for pr and diff in /bin
* kill a warning: include <string.h>david2003-06-271-1/+2
| | | | ok tedu@
* Remove cruft; We don't have the -I, -1 or -2 options anymore so we don'tmillert2003-06-261-12/+4
| | | | need the associated scaffolding. tedu@ OK
* Fix -r flag that was broken during getopt() conversion--whoops.millert2003-06-261-2/+2
|
* Fix temp file handling.millert2003-06-261-15/+39
| | | | | | | | | o honor TMPDIR environment variable as per man page o need 2 temp files if both file1 and file2 are devices o add error() and errorx() which cleanup temp file and then call err() and errx() respectively. OK tedu@
* pretty code that prints usagederaadt2003-06-261-3/+5
|