summaryrefslogtreecommitdiffstats
path: root/usr.bin/diff/diffdir.c
AgeCommit message (Collapse)AuthorFilesLines
2019-01-25I am retiring my old email address; replace it with my OpenBSD one.millert1-2/+2
2017-08-28Fix exit value when diffing directories with missing files and the -Nmillert1-7/+11
or -P options are not used. From Ibrahim Khalifa
2015-10-05Remove the non-standard -l flag that pipes the output through pr(1).millert1-22/+2
Based on a diff from and OK deraadt@
2015-09-25xmalloc/free wrappers don't need to support 20 year old non comformancetedu1-5/+5
2015-01-16Replace <sys/param.h> with <limits.h> and other less dirty headers wherederaadt1-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)
2014-05-20Use errc/warnc to simplify code.guenther1-3/+3
Also, in 'ftp', always put the error message last, after the hostname/ipaddr. ok jsing@ krw@ millert@
2012-11-29Change scandir()'s 'select' argument fromguenther1-3/+3
int (*)(struct dirent *) to int (*)(const struct dirent *) to match POSIX. ok millert@, ports check by naddy@
2010-11-14scandir() does not NULL-terminate the list of dirent structs so usemillert1-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@
2010-11-08getdirentries(2) should be avoided outside of libc so use scandir(3)millert1-115/+41
instead. This makes slurpdir() just a thin wrapper around scandir(3). OK schwarze@
2010-10-28Change basep parameter of getdirentries() to be off_t *, not long *millert1-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@
2010-07-17Plug memory leak.ray1-3/+5
OK nicm
2010-07-16Simplify print_status by removing NULL handling.ray1-2/+2
OK nicm
2009-10-27rcsid[] and sccsid[] and copyright[] are essentially unmaintained (andderaadt1-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
2009-06-07More cvs/diff/rcs convergence:ray1-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
2009-06-06Oops, forgot to pass dflags to diffreg. Now the flags work again.ray1-11/+13
OK millert
2007-06-09- Change sizeof(type) to sizeof(*ptr).ray1-3/+3
- Move function prototypes before variables. No binary change. OK otto and millert.
2007-05-29Bring in some changes from rcsdiff:ray1-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@
2005-06-15bye bye whiteoutsmillert1-5/+4
2004-11-26Fix the getdirentries() loop memory handling and EOF detection.otto1-15/+22
Also fix typo in sizeof. Problem spotted by YAMAMOTO Takashi; this diff joint work with millert@ ok millert@
2004-10-02Keep calling getdirentries() until we no longer fill up our buffer.millert1-14/+22
2004-03-16POSIX specifies that in directory mode device special files andmillert1-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@
2003-11-09Typos in comments from Jared Yanovich <jjy2+ at pitt dot edu>otto1-3/+3
2003-10-07Fix printing of "Only in foo" when foo is "/" (trailing slash removalmillert1-6/+4
was overzealous in this case). Fix tested by Hugo Villeneuve and myself.
2003-07-21Historically, the "Only in" messages produced in dir modemillert1-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.
2003-07-21Fix printing of status when not in -l mode which was broken when themillert1-4/+6
-l support was added.
2003-07-09Re-implement -l flag; diff -l now works correctly in non-directorymillert1-4/+27
mode (like GNU diff).
2003-07-06Add -q option from GNU diffmillert1-4/+4
2003-07-06Implement -P from GNU diff (like -N but only for files that are missingmillert1-14/+14
from dir1).
2003-07-06Some fairly major changes:millert1-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@
2003-07-06Use symbolic constants for output format.millert1-3/+5
2003-07-04Kill non-standard -l option as discussed with tedu@millert1-111/+22
2003-07-04Some cosmetic fixes:millert1-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
2003-06-27-a to force ascii compare. ok millerttedu1-1/+4
2003-06-26Fix temp file handling.millert1-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@
2003-06-25Add unidiff support and try to pretty up usage() a bitmillert1-2/+2
2003-06-25o use S_ISDIR instead of doing it by handmillert1-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
2003-06-25o use getopt()millert1-11/+7
o use err/warn o only call done() when needed (after mkstemp) o add "-C lines" like GNU grep OK deraadt@
2003-06-25more knfderaadt1-2/+3
2003-06-25knfderaadt1-11/+8
2003-06-25-Wstrict-prototypestedu1-5/+10
2003-06-25exit path signal race safederaadt1-8/+8
2003-06-25fix lseekderaadt1-2/+2
2003-06-25snprintfderaadt1-2/+3
2003-06-25more cast removal, and fix some indent(1) odditiestedu1-12/+7
2003-06-25cleanup. ansi, headers, correct prototypes, some safer string andtedu1-99/+94
tempfile functions, whitespace, ... no functional improvements yet
2003-06-25caldera licensesderaadt1-0/+36
2003-06-254.3reno diff. This is free because of the Caldera license. Nasty, but aderaadt1-0/+419
place to start.