summaryrefslogtreecommitdiffstats
path: root/usr.bin/diff/diffdir.c (follow)
Commit message (Collapse)AuthorAgeFilesLines
* Remove the non-standard -l flag that pipes the output through pr(1).millert2015-10-051-22/+2
| | | | Based on a diff from and OK deraadt@
* xmalloc/free wrappers don't need to support 20 year old non comformancetedu2015-09-251-5/+5
|
* Replace <sys/param.h> with <limits.h> and other less dirty headers wherederaadt2015-01-161-5/+5
| | | | | | | | | 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)
* Use errc/warnc to simplify code.guenther2014-05-201-3/+3
| | | | | | Also, in 'ftp', always put the error message last, after the hostname/ipaddr. ok jsing@ krw@ millert@
* Change scandir()'s 'select' argument fromguenther2012-11-291-3/+3
| | | | | | | | | int (*)(struct dirent *) to int (*)(const struct dirent *) to match POSIX. ok millert@, ports check by naddy@
* scandir() does not NULL-terminate the list of dirent structs so usemillert2010-11-141-42/+39
| | | | | | | the returned count and set and end pointer instead. we no longer need to allocate a dummy array when diffing against a non-existent directory so eliminate slurpdir() and call scandir() directly. OK krw@
* getdirentries(2) should be avoided outside of libc so use scandir(3)millert2010-11-081-115/+41
| | | | | instead. This makes slurpdir() just a thin wrapper around scandir(3). OK schwarze@
* Change basep parameter of getdirentries() to be off_t *, not long *millert2010-10-281-2/+2
| | | | | | | | so it works correctly with large offsets (and matches other systems). This requires adding a new getdirentries syscall, with the old one renamed to ogetdirentries. All in-tree consumers of getdirentries() have been updated. Bump libc and libpthread major numbers. OK and with deraadt@
* Plug memory leak.ray2010-07-171-3/+5
| | | | OK nicm
* Simplify print_status by removing NULL handling.ray2010-07-161-2/+2
| | | | OK nicm
* 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-3/+3
| | | | | | | | | | | 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-11/+13
| | | | OK millert
* - Change sizeof(type) to sizeof(*ptr).ray2007-06-091-3/+3
| | | | | | | | - Move function prototypes before variables. No binary change. OK otto and millert.
* Bring in some changes from rcsdiff:ray2007-05-291-10/+11
| | | | | | | | | 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@
* bye bye whiteoutsmillert2005-06-151-5/+4
|
* Fix the getdirentries() loop memory handling and EOF detection.otto2004-11-261-15/+22
| | | | | | | Also fix typo in sizeof. Problem spotted by YAMAMOTO Takashi; this diff joint work with millert@ ok millert@
* Keep calling getdirentries() until we no longer fill up our buffer.millert2004-10-021-14/+22
|
* POSIX specifies that in directory mode device special files andmillert2004-03-161-3/+8
| | | | | | 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@
* Typos in comments from Jared Yanovich <jjy2+ at pitt dot edu>otto2003-11-091-3/+3
|
* Fix printing of "Only in foo" when foo is "/" (trailing slash removalmillert2003-10-071-6/+4
| | | | was overzealous in this case). Fix tested by Hugo Villeneuve and myself.
* 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.
* Fix printing of status when not in -l mode which was broken when themillert2003-07-211-4/+6
| | | | -l support was added.
* Re-implement -l flag; diff -l now works correctly in non-directorymillert2003-07-091-4/+27
| | | | mode (like GNU diff).
* Add -q option from GNU diffmillert2003-07-061-4/+4
|
* Implement -P from GNU diff (like -N but only for files that are missingmillert2003-07-061-14/+14
| | | | from dir1).
* Some fairly major changes:millert2003-07-061-303/+230
| | | | | | | | | | | | | | | | | | | | | 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@
* Use symbolic constants for output format.millert2003-07-061-3/+5
|
* Kill non-standard -l option as discussed with tedu@millert2003-07-041-111/+22
|
* Some cosmetic fixes:millert2003-07-041-7/+6
| | | | | | | | 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
* -a to force ascii compare. ok millerttedu2003-06-271-1/+4
|
* Fix temp file handling.millert2003-06-261-20/+12
| | | | | | | | | 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@
* Add unidiff support and try to pretty up usage() a bitmillert2003-06-251-2/+2
|
* o use S_ISDIR instead of doing it by handmillert2003-06-251-17/+30
| | | | | | | | 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
* o use getopt()millert2003-06-251-11/+7
| | | | | | | o use err/warn o only call done() when needed (after mkstemp) o add "-C lines" like GNU grep OK deraadt@
* more knfderaadt2003-06-251-2/+3
|
* knfderaadt2003-06-251-11/+8
|
* -Wstrict-prototypestedu2003-06-251-5/+10
|
* exit path signal race safederaadt2003-06-251-8/+8
|
* fix lseekderaadt2003-06-251-2/+2
|
* snprintfderaadt2003-06-251-2/+3
|
* more cast removal, and fix some indent(1) odditiestedu2003-06-251-12/+7
|
* cleanup. ansi, headers, correct prototypes, some safer string andtedu2003-06-251-99/+94
| | | | | 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/+419
place to start.