summaryrefslogtreecommitdiff
path: root/usr.bin/diff
AgeCommit message (Collapse)Author
2013-01-20remove obsolete BUGS (cmp is not run internally); ok ottoJason McIntyre
2012-11-29Change scandir()'s 'select' argument fromPhilip Guenthe
int (*)(struct dirent *) to int (*)(const struct dirent *) to match POSIX. ok millert@, ports check by naddy@
2012-07-08Switch diff(1) binary file detection from !(isprint() || isspace()) toStefan Sperling
checking for embedded NULs, as was done for grep(1) some time ago. Avoids problems with e.g. latin1-encoded files being treated as binary, since isprint() uses only ASCII by default and diff(1) doesn't call setlocale(). prodded by and ok bluhm
2012-05-22Strip trailing slashes from directory in splice() beforeTodd C. Miller
appending the file portion. OK krw@ matthew@
2011-04-01Move an isqrt() call outside a macro, from Michael W Bombardieri.Nicholas Marriott
ok ray
2011-02-03add a reference to the "An Algorithm for Differential File Comparison" paper;Jason McIntyre
diff originally from Daniel Dickman, but otto suggested this paper ok otto millert
2010-11-14scandir() does not NULL-terminate the list of dirent structs so useTodd C. Miller
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)Todd C. Miller
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 *Todd C. Miller
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-09-03add an EXIT STATUS section for /usr/bin;Jason McIntyre
2010-08-18Add a cross reference to patch(1)Ingo Schwarze
as suggested by Thomas de Grivel <billitch at gmail dot com> on tech@. While here, remove the SEE ALSO entries (but not the cross references at the appropriate places!) to fnmatch(3), re_format(7), and pr(1). Their relevance is restricted to one single option each, the latter is mostly obsolete nowadays anyway, and the number of SEE ALSO entries is so large that SEE ALSO is starting to look confusing. "yes" jmc@
2010-08-04exit(2) on xcalloc failure. From Daniel Dickman <didickman () gmailRay Lai
! com>, thanks! OK deraadt
2010-07-17Plug memory leak.Ray Lai
OK nicm
2010-07-16Simplify print_status by removing NULL handling.Ray Lai
OK nicm
2010-07-16Close FILEs when fork fails.Ray Lai
OK nicm
2010-07-16diff exits 2 on error, not 1.Ray Lai
OK millert
2010-07-15cvs and rcs use diff_output() to print everything since it is notRay Lai
always to stdout. A large number of differences are due to this. This diff reduces many more differences between diff and cvs/rcs. Personally I think it's kinda ugly. =( "Looks fine" millert
2010-07-15Remove unused arguments from check(). From cvs/rcs.Ray Lai
OK millert
2010-07-14Return -1 on error as advertised.Ray Lai
Handle case when only one stream failed. OK otto, millert
2010-03-22Even though this cannot happen in the diff -r case,Ingo Schwarze
even though diff(1) will exit(3) soon after this mkstemp(3) failure, even though this cannot really leak anything, close the file descriptor as soon as it is not used any more to make correctness of the code more obvious. patch from Igor Zinovik <zinovik dot igor at gmail dot com> on tech@ "looks nice" deraadt@
2010-02-21`-q' is an output option, hence it is mutually exclusive.Igor Sobrado
ok jmc@
2009-11-09move mutually exclusive options (-c, -e, -f, -n and -u) to the right place.Igor Sobrado
ok jmc@
2009-10-28rcsid[] and sccsid[] and copyright[] are essentially unmaintained (andTheo de Raadt
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:Ray Lai
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.Ray Lai
OK millert
2009-06-06Pull changes from rcsdiff, similar to what was pulled into cvsdiff.Ray Lai
OK millert
2009-02-08updates to IEEE Std 1003.1-2008;Jason McIntyre
2009-02-08bump the posix reference in STANDARDS to IEEE Std 1003.1-2008, with a fewJason McIntyre
updates to follow;
2007-09-11use strcspn to properly overwrite '\n' in fgets returned bufferGilles Chehade
ok pyr@, ray@, millert@, moritz@, chl@
2007-06-09- Change sizeof(type) to sizeof(*ptr).Ray Lai
- Move function prototypes before variables. No binary change. OK otto and millert.
2007-05-31convert to new .Dd format;Jason McIntyre
2007-05-30- use a consistent text for STANDARDSJason McIntyre
- note which options are extensions to POSIX
2007-05-29Bring in some changes from rcsdiff:Ray Lai
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@
2007-03-18improve -p for C++ code: classes definition often haveMarc Espie
public:/protected:/private: at the start of line. This lets the -p scanner just take note of the section and keep looking for the actual class definition. Also increase function name bufsize so it shows most of these pesky C++ decls... okay otto@
2007-03-01sort options/synopsis/usage();Jason McIntyre
from Igor Sobrado
2007-02-23print the header only once.Marc Espie
okay millert@
2007-02-22Defer printing of the per-file diff header until after the regexpTodd C. Miller
"ignore" processing has finished. This way we only print the header for files that have diffs. The new behavior matches GNU diff (which is where the -I flag comes from). OK otto@ espie@
2006-05-05- no need to escape theseJason McIntyre
2006-02-22Append two string using strlcpy()/strlcat() instead of snprintf() toOtto Moerbeek
avoid having to check for encoding errors returned by snprintf(). From Ray Lai; ok millert@ jaredy@
2006-02-16Strip newline from lines used with -I, otherwise ^$ will match allOtto Moerbeek
lines and ignore them all. With and ok jaredy@
2005-12-27+.Xr sdiff 1 ,Jason McIntyre
2005-06-15bye bye whiteoutsTodd C. Miller
2005-01-13Handle all isspace() chars the same for -w and -b. ok millert@ markus@Otto Moerbeek
2005-01-06clarify what -a does;Jason McIntyre
prod and ok deraadt@
2004-12-09If the -L option is specified twice, use it for the second filenameTodd C. Miller
like GNU diff does. Adapted from a diff by YAMAMOTO Takashi
2004-12-07advancing argv twice doesn't make it better.Marc Espie
okay otto@.
2004-11-27Use unsigned char for bytes that are fed to isxxx() functions, to improveOtto Moerbeek
portability. Spotted by YAMAMOTO Takashi. ok millert@
2004-11-26Fix the getdirentries() loop memory handling and EOF detection.Otto Moerbeek
Also fix typo in sizeof. Problem spotted by YAMAMOTO Takashi; this diff joint work with millert@ ok millert@
2004-10-20Change tabs in string constants to \t. "of course" deraadt@Otto Moerbeek
2004-10-02Keep calling getdirentries() until we no longer fill up our buffer.Todd C. Miller