summaryrefslogtreecommitdiffstats
path: root/usr.bin/diff (follow)
Commit message (Collapse)AuthorAgeFilesLines
* Add some references, most of these were removed when we stopped buildingjsg2021-03-081-3/+4
| | | | | | and installing USD/SMM/PSD docs. jmc@ agrees with the direction, ok millert@ on an earlier diff
* restore RCS id removed in 1.33jcs2020-11-011-2/+2
|
* correct Research Unix edition "appeared in" use in HISTORYjsg2020-02-081-3/+3
| | | | | | | | | | | | | | | | | Starting from "Combined Table of Contents" in Doug McIlroy's "A Research UNIX Reader" a table of which edition manuals appeared in. Checked against manuals from bitsavers/TUHS and source from TUHS where available. Ingo points out there are cases where something is included but not documented until a later release. bcd(6) v6 v7 printf(3) v2 v4 abort(3) v5 v6 system(3) v6 v7 fmod(3) v5 v6 ok schwarze@
* When system calls indicate an error they return -1, not some arbitraryderaadt2019-06-282-8/+8
| | | | | | value < 0. errno is only updated in this case. Change all (most?) callers of syscalls to follow this better, and let's see if this strictness helps us in the future.
* asprintf returns -1, not an arbitrary value < 0. Also upon error thederaadt2019-06-281-2/+2
| | | | | | | (very sloppy specification) leaves an undefined value in *ret, so it is wrong to inspect it, the error condition is enough. discussed a little with nicm, and then much more with millert until we were exasperated
* mkstemp() returns -1 on failurederaadt2019-06-281-2/+2
|
* remove incorrect escaping of '+', correctly escape '-', and garbage collect .Tnschwarze2019-03-201-9/+6
|
* I am retiring my old email address; replace it with my OpenBSD one.millert2019-01-252-4/+4
|
* Fix exit value when diffing directories with missing files and the -Nmillert2017-08-281-7/+11
| | | | or -P options are not used. From Ibrahim Khalifa
* Rectify line numbers for s/.// commands in ed-style diffs.natano2016-03-011-3/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | When diff encounters a line that consists of a single dot, it emits two dots instead, stops the current command and emits a substitute command to replace the double dot with a single one. Then it restarts the (original) command if necessary and inserts further lines. This is done because a single dot on a line does have special meaning in ed. (It stops text insertion.) Following issues are fixed by this commit. - The line number for the substitute command should be the number of the most recently inserted line. diff instead uses the number of the first inserted line of the current hunk. The first character of that line is removed when applying the diff, while the superfluous dot is not. - The line number of the restarted command is not adjusted for the number of lines already inserted, resulting in the reordering of lines.. - When there is a bare dot in the replacement text of a change command, too many lines are deleted, because a second change command is emitted. An append command should be emitted instead, because the target lines have already been removed by the first change command. tweaks and ok stefan@
* fix exit status on pledge(2) failure.gsoares2015-12-291-2/+2
| | | | OK tb@ jsg@
* fix an error in the text; from donald allenjmc2015-11-241-3/+3
| | | | ok millert
* Merge xmalloc.[ch] files across base, skipping OpenSSH for now.tobias2015-11-171-7/+9
| | | | ok nicm
* Remove xfree()'s prototype. tedu@ removed its definition a few weeksmmcc2015-11-121-2/+1
| | | | ago. Pointed out by Ricardo Mestre.
* no more TMPDIR;jmc2015-10-261-5/+2
|
* remove TMPDIR support. ok millerttedu2015-10-263-33/+8
|
* 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