summaryrefslogtreecommitdiffstats
path: root/usr.bin/diff/diff.c (follow)
Commit message (Collapse)AuthorAgeFilesLines
* 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
|
* Fix temp file handling and deal with the case where we might need 2 temp files.millert2003-06-261-6/+8
|
* put all the flags and globals in diff.c, and declare externs in diff.htedu2003-06-261-2/+41
| | | | ok millert@
* Add a space after flags that take an argumnent in usage() since getopt()millert2003-06-251-5/+5
| | | | supports that.
* De-uglify usagemillert2003-06-251-5/+5
|
* Add unidiff support and try to pretty up usage() a bitmillert2003-06-251-6/+18
|
* o use S_ISDIR instead of doing it by handmillert2003-06-251-6/+5
| | | | | | | | o rename talloc -> emalloc and ralloc -> erealloc o struct direct -> struct dirent (POSIX) o kill remaining strcpy() o fix unterminated string in setfile() deraadt@ OK
* Fix getopt string for -Dmillert2003-06-251-2/+2
|
* o use getopt()millert2003-06-251-119/+86
| | | | | | | o use err/warn o only call done() when needed (after mkstemp) o add "-C lines" like GNU grep OK deraadt@
* remove silly signal catcher, and just use done. ok deraadt@tedu2003-06-251-8/+1
|
* exit path signal race safederaadt2003-06-251-12/+14
|
* cleanup. ansi, headers, correct prototypes, some safer string andtedu2003-06-251-125/+127
| | | | | tempfile functions, whitespace, ... no functional improvements yet
* caldera licensesderaadt2003-06-251-0/+36
|
* 4.3reno diff. This is free because of the Caldera license. Nasty, but aderaadt2003-06-251-0/+212
place to start.