summaryrefslogtreecommitdiffstats
path: root/usr.bin/diff (follow)
Commit message (Collapse)AuthorAgeFilesLines
* If a new hunk immediately follows the previous one, merge themotto2004-06-181-4/+4
| | | | | | | into a single hunk. This makes diff produce the same diff as gdiff in more cases. Found by brad@ and sturm@ using the ports tree. ok millert@
* POSIX specifies that in directory mode device special files andmillert2004-03-164-7/+25
| | | | | | 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@
* use new .St macro;jmc2004-01-251-2/+2
|
* Document -p option. ok jmc@otto2004-01-071-5/+11
|
* Implement -p option.otto2004-01-073-17/+76
| | | | "works here" millert@ ok miod@ deraadt@
* Fix diff -q exit value which was broken in last commit.millert2003-11-221-4/+5
|
* Fix broken assumption that a file must contain differences if files_differ()millert2003-11-211-7/+7
| | | | fails. Fixes "diff -i" exit value. Problem found by Claudio Jeker.
* Din't print the "No newline at end of file" to inline (ie: to stdout)millert2003-11-101-4/+8
| | | | | | for edit scripts. Instead, print it to stderr. This matches the GNU diff behavior and fixes a problem with RCS and files with no trailing newline. tedu@ OK
* Typos in comments from Jared Yanovich <jjy2+ at pitt dot edu>otto2003-11-092-5/+5
|
* prototype declared static, but function was not. add static to function.avsm2003-10-281-3/+3
| | | | millert@ otto@ ok
* Fix printing of "Only in foo" when foo is "/" (trailing slash removalmillert2003-10-073-12/+17
| | | | was overzealous in this case). Fix tested by Hugo Villeneuve and myself.
* - move `-d' to comparison options, rather then output optionsjmc2003-09-181-6/+6
| | | | | | - note (again) that output options are mutually exclusive from Andy Isaacson (PR 3479)
* Make -number be an error (similar to my change in grep.c); OK tedu@millert2003-09-071-9/+15
|
* - add -P to SYNOPSISjmc2003-09-072-13/+13
| | | | | | | | | - 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
|
* correct ascii file test. ok deraadt@ pb@tedu2003-09-071-5/+4
|
* 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@
* Based on what otto@ said on icb. The expensive thing in diff ismillert2003-08-131-6/+6
| | | | | | | | newcand() (this is what blows up the memory usage so badly). Instead of counting how many times we go through the loop, count how many times we called newcand(). I renamed loopcount -> numtries since it is no longer the number of loop runs. This fixes espie@'s regression. tedu@ OK
* Guess the number of lines in a file and use that number for initialotto2003-08-081-8/+12
| | | | | | memory allocation. Initial version by me, cleanup by millert@. ok millert@
* anychange is no longer extern; millert okderaadt2003-08-011-2/+2
|
* - Change the hash function to a simple multiplicative one. The oldotto2003-07-311-25/+29
| | | | | | | | hash function was apparently optimized for 16 bit processors and generates quite some collisions. - Fix another case of excessive reallocing. ok millert@
* o correct exit code when comparing stdin and stdin (a noop)millert2003-07-311-4/+4
| | | | | | o after copying to a temp file, lseek() to the beginning so the inline cmp routine works. Fixes an exit code issue when comparing against stdin.
* cleanderaadt2003-07-292-7/+7
|
* We need to initialize clen to 0 each time through diffreg() formillert2003-07-271-2/+3
| | | | | when diffreg() is called multiple times (i.e. in directory mode). Fixes a hang I saw doing "diff -r" of two large directory trees.
* Correct computation of argsize when setting diffargs.millert2003-07-271-4/+4
|
* Start new sentence on a new line.otto2003-07-271-4/+4
| | | | ok jmc@
* - Use a heuristic to bound memory and cpu usage, at the cost ofotto2003-07-274-26/+68
| | | | | | | | | 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@
* better ascii test for fewer false negatives. ok millert@tedu2003-07-231-5/+5
|
* Add missing terminator to long options list.millert2003-07-221-2/+3
|
* Fixed the "dot alone on a line" bug.millert2003-07-221-12/+1
|
* Bring FILES section up to date.millert2003-07-221-12/+6
|
* Implement the -L and -T options from GNU diff.millert2003-07-224-57/+90
|
* Historically, when comparing two directories in -e mode, BSD diffmillert2003-07-221-14/+5
| | | | | | printed a header that turned the output into an actual script that called ed(1) to make the changes. This conflicts with POSIX so the header has been removed and the standard diff header is used instead.
* Don't print lines consisting solely of a dot ('.') in -e mode sincemillert2003-07-221-9/+38
| | | | | | | | that will confuse ed(1). POSIX says "one way to fix this bug is to output two periods whenever a lone period is needed, then terminate the append command with a period, and then use the substitute command to convert the two periods into one period." This is exactly what I have done.
* Historically, the "Only in" messages produced in dir modemillert2003-07-211-10/+5
| | | | | | | | | were not printed when the output format was -e (ed) since this prevented the output from being used as an ed script. However, POSIX specifies that this message shall always be printed regardless of the output format (this is also what GNU diff does). Also do the same with the "Common subdirectory" message which POSIX lists as optional.
* Add STANDARDS sectionmillert2003-07-211-1/+7
|
* 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-212-8/+10
| | | | -l support was added.
* a little KNFhenning2003-07-212-6/+6
|
* POSIX-compliant output when there are two paths w/ the same name butmillert2003-07-213-10/+15
| | | | one is a file and the other is a directory in -r mode (cosmetic).
* Expand change records array as needed; passes Otto's new regression test.millert2003-07-211-40/+46
|
* cc -O2 -pipe -DSTDC_HEADERS=1 -DHAVE_UNISTD_H=1 -DDIRENT=1 -DDYN_ALLOC -c unpGet rid of ugly hack in readhash() that appears to be there formillert2003-07-171-26/+7
| | | | | | machines with a 16 bit word size. Also replace (HALFLONG - 1) with a new define, HASHMASK since it really is a mask. None of this results in any actual change in behavior.
* Deal with files that lack a final newline before EOF (you naughtymillert2003-07-161-24/+42
| | | | | | | | | | | | | | | | | emacs users!). In most cases this just means checking for EOF in addition to '\n'. However, we need to tread carefully in readhash(). There we return 0 on EOF iff it is the first char in a "line". Additionally, if the -b or -w flags were specified and the last character in one file was '\n' but the other file is missing '\n', pretend that we didn't see the newline in the one file. This is consistent with GNU diff. For the non-{b,w} case, print "\ No newline at end of file" when we see EOF before a newline in one file where the other file has one. Again, this is for consistency with GNU diff and patch(1) in -current knows how to interpret this message. OK tedu@ and otto@
* Fix line ranges for unidiffs. Problem noted by otto@millert2003-07-151-12/+27
|
* Unlink temp file as soon as it is opened and return a FILE * formillert2003-07-093-123/+67
| | | | | | | | | | | 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-096-49/+219
| | | | mode (like GNU diff).
* fix pasto in last commitmillert2003-07-081-3/+3
|
* o Avoid a temp file if using stdin and stdin is redirected from a regular filemillert2003-07-082-15/+19
| | | | o Fix a double free in the temmp file case
* Add -q option from GNU diffmillert2003-07-065-21/+33
|