summaryrefslogtreecommitdiffstats
path: root/usr.bin/diff (follow)
Commit message (Collapse)AuthorAgeFilesLines
* Replace our /^\.\././ expression with /.//. The term is simpler and hastobias2015-10-131-2/+2
| | | | | | | | the same meaning in our diff ed-context. As a bonus, our ed-diff output can be processed by GNU patch now, too. okay millert@
* Change all tame callers to namechange to pledge(2).deraadt2015-10-091-5/+5
|
* Remove the non-standard -l flag that pipes the output through pr(1).millert2015-10-056-152/+29
| | | | Based on a diff from and OK deraadt@
* use different tame requests if TMPDIR is in env:semarie2015-10-051-3/+8
| | | | | | | | | - tmppath for when mktemp() operates in /tmp proper - cpath+wpath for use of $TMPDIR based on log-message from previous commit ok deraadt@
* If the -l flag is set, diff will fork/execve pr on a pipe. But otherderaadt2015-10-051-1/+5
| | | | | | uses can tame "stdio wpath rpath cpath tmppath". tmppath for when mktemp() operates in /tmp proper, but cpath+wpath for use of $TMPDIR. ok sthen millert
* xmalloc/free wrappers don't need to support 20 year old non comformancetedu2015-09-253-34/+20
|
* Use strdup in xstrdup; from Fritjof Bornebusch.nicm2015-06-171-5/+3
|
* Change internal xrealloc() to a idiom-following xreallocarray().deraadt2015-04-294-24/+16
| | | | | | | This loses a "new size is 0" failure case. Probably not relevant; and since we develop this in OpenBSD, we'll catch that before someone else imports this... ok millert
* Include stdint.h, not limits.h to get SIZE_MAX. OK guenther@millert2015-02-052-3/+4
|
* Replace <sys/param.h> with <limits.h> and other less dirty headers wherederaadt2015-01-163-19/+22
| | | | | | | | | 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)
* Ensure diff -uw always produces valid output when one file doesn't endkspillner2014-08-271-5/+9
| | | | | | with a newline. Issue reported by guenther@. ok guenther@
* 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@
* TMPDIR is an extension;jmc2014-02-131-4/+7
| | | | while here, converting \*(Gt to >, in accordance with some advice from ingo
* Fix bogus errx(2, NULL) usage; malloc() failure should use err(2, NULL).millert2013-08-191-8/+8
| | | | | For size and overflow errors, use the same error messages as ecalloc(). OK otto@
* where "-" represents stdin, just use Sq, not Fl, since it's not a flag;jmc2013-07-161-3/+3
| | | | from Jan Stary
* remove obsolete BUGS (cmp is not run internally); ok ottojmc2013-01-201-18/+2
|
* 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@
* Switch diff(1) binary file detection from !(isprint() || isspace()) tostsp2012-07-081-6/+3
| | | | | | | 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
* Strip trailing slashes from directory in splice() beforemillert2012-05-221-2/+6
| | | | appending the file portion. OK krw@ matthew@
* Move an isqrt() call outside a macro, from Michael W Bombardieri.nicm2011-04-011-6/+9
| | | | ok ray
* add a reference to the "An Algorithm for Differential File Comparison" paper;jmc2011-02-031-2/+10
| | | | | | diff originally from Daniel Dickman, but otto suggested this paper ok otto millert
* 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@
* add an EXIT STATUS section for /usr/bin;jmc2010-09-031-4/+4
|
* Add a cross reference to patch(1)schwarze2010-08-181-6/+4
| | | | | | | | | | 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@
* exit(2) on xcalloc failure. From Daniel Dickman <didickman () gmailray2010-08-041-4/+4
| | | | | | ! com>, thanks! OK deraadt
* Plug memory leak.ray2010-07-171-3/+5
| | | | OK nicm
* Simplify print_status by removing NULL handling.ray2010-07-162-14/+12
| | | | OK nicm
* Close FILEs when fork fails.ray2010-07-161-2/+3
| | | | OK nicm
* diff exits 2 on error, not 1.ray2010-07-161-2/+2
| | | | OK millert
* cvs and rcs use diff_output() to print everything since it is notray2010-07-151-52/+50
| | | | | | | | 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
* Remove unused arguments from check(). From cvs/rcs.ray2010-07-151-4/+4
| | | | OK millert
* Return -1 on error as advertised.ray2010-07-141-5/+4
| | | | | | Handle case when only one stream failed. OK otto, millert
* Even though this cannot happen in the diff -r case,schwarze2010-03-221-2/+4
| | | | | | | | | | 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@
* `-q' is an output option, hence it is mutually exclusive.sobrado2010-02-212-17/+17
| | | | ok jmc@
* move mutually exclusive options (-c, -e, -f, -n and -u) to the right place.sobrado2009-11-092-9/+9
| | | | ok jmc@
* rcsid[] and sccsid[] and copyright[] are essentially unmaintained (andderaadt2009-10-273-15/+3
| | | | | | | 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-076-82/+92
| | | | | | | | | | | 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-063-17/+19
| | | | OK millert
* Pull changes from rcsdiff, similar to what was pulled into cvsdiff.ray2009-06-063-92/+109
| | | | OK millert
* updates to IEEE Std 1003.1-2008;jmc2009-02-081-2/+2
|
* bump the posix reference in STANDARDS to IEEE Std 1003.1-2008, with a fewjmc2009-02-081-3/+3
| | | | updates to follow;
* use strcspn to properly overwrite '\n' in fgets returned buffergilles2007-09-111-6/+4
| | | | ok pyr@, ray@, millert@, moritz@, chl@
* - Change sizeof(type) to sizeof(*ptr).ray2007-06-092-45/+45
| | | | | | | | - Move function prototypes before variables. No binary change. OK otto and millert.
* convert to new .Dd format;jmc2007-05-311-2/+2
|
* - use a consistent text for STANDARDSjmc2007-05-301-3/+7
| | | | - note which options are extensions to POSIX
* Bring in some changes from rcsdiff:ray2007-05-296-120/+194
| | | | | | | | | 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@
* improve -p for C++ code: classes definition often haveespie2007-03-181-6/+23
| | | | | | | | | | | 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@
* sort options/synopsis/usage();jmc2007-03-012-54/+51
| | | | from Igor Sobrado