summaryrefslogtreecommitdiffstats
path: root/usr.bin/sort/msort.c (follow)
Commit message (Collapse)AuthorAgeFilesLines
* Replace <sys/param.h> with <limits.h> and other less dirty headers wherederaadt2015-01-161-1/+3
| | | | | | | | | 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)
* repair buffer resizing "undershoot", and some minor issues withderaadt2013-11-131-2/+2
| | | | | math on void * assistance from guenther, ok millert
* implement -C (silent -c), required by POSIX.1-2008;schwarze2009-12-221-6/+13
| | | | | patch from Daniel Dickman <didickman at gmail dot com> tweaked by me; "looks ok" millert@, manual help and ok jmc@
* rcsid[] and sccsid[] and copyright[] are essentially unmaintained (andderaadt2009-10-271-9/+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
* Add a -s option to make the radix sort be a stable sort. Based onmillert2007-08-211-3/+3
| | | | a diff from Eric Gouyer. Closes PR 5553. OK deraadt@
* Use separate buffers in fsort.c and msort.c. Fixes a problem withmillert2007-03-131-27/+17
| | | | | buffer corruptions for some very large files. Also fixes some TRECHEADER vs. RECHEADER mismatches. Back in after unlock.
* some bug (in sort? or compiler) gets hit too late in the release cycle.deraadt2007-03-111-17/+27
| | | | please try again right after release.
* Use separate buffers in fsort.c and msort.c. Fixes a problem withmillert2007-03-071-27/+17
| | | | | buffer corruptions for some very large files. Also fixes some TRECHEADER vs. RECHEADER mismatches. OK deraadt@ otto@ ray@
* Remove useless code that can cause a SEGV if a buffer is realloc()ed.millert2006-10-291-15/+15
| | | | | | Allocate buffers early and in one place instead of two. Make bufend global so it can be updated along with buffer. OK deraadt@
* revert previous change; causes segfault when called fromnaddy2006-10-281-13/+15
| | | | pkg_mklocatedb/locate.mklocatedb
* Remove useless code that can cause a SEGV if a buffer is realloc()ed.millert2006-10-181-15/+13
| | | | | Allocate buffers early and in one place instead of two. Fixes PR 5252; OK deraadt
* ansi; khalek@linuxgamers.netderaadt2004-07-201-24/+14
|
* protosderaadt2003-06-261-7/+6
|
* Remove the advertising clause in the UCB license which Berkeleymillert2003-06-031-7/+3
| | | | rescinded 22 July 1999. Proofed by myself and Theo.
* Part one of userland __P removal. Done with a simple regexp with some minor hand editing to make comments line up correctly. Another pass is forthcoming that handles the cases that could not be done automatically.millert2002-02-161-4/+4
|
* Align the pointers when splitting up a mallocated area.art2002-01-041-6/+7
| | | | | Cures alignment faults on alpha and sparc64. OK: niklas@ ericj@ millert@
* Bring in some recent fixup's from NetBSD. This allows lines longer than 65522ericj2001-02-041-13/+21
| | | | | to be properly sorted. Many other cleanup's done, and depreciate register. millert@ and deraadt@ ok.
* warnx?/errx? paranoia (use "%s" not a bare string unless it is amillert2000-06-301-3/+3
| | | | | | | | | constant). These are not security holes but it is worth fixing them anyway both for robustness and so folks looking for examples in the tree are not misled into doing something potentially dangerous. Furthermore, it is a bad idea to assume that pathnames will not include '%' in them and that error routines don't return strings with '%' in them (especially in light of the possibility of locales).
* Dynamically allocate memory for structures whose sizes are based on themillert1999-05-241-9/+18
| | | | number of keys given. Closes PR #825.
* 64bit fixes. Some of these are a bit bogus as there were "long"smillert1997-06-301-9/+9
| | | | | meant to be file offsets for fseek(3). However, those values could never be > an int anyay so it is not a problem.
* Fix an unaligned access on alpha.millert1997-06-301-3/+3
|
* Cosmetic cleanup, mostly KNF.millert1997-06-161-23/+25
|
* Fix some err(3) usage and usage string.millert1997-01-221-3/+3
|
* Fix off-by-one differently--add an extra byte to buffer (ick).millert1997-01-221-17/+20
| | | | Don't dump core on empty file.
* sort(1) from 4.4BSD-lite2 with minor tweaks and bug fixes by me.millert1997-01-201-0/+310