summaryrefslogtreecommitdiff
path: root/usr.bin/sort
AgeCommit message (Collapse)Author
2003-10-18KNF (mostly whitespace)itojun
2003-10-17Test the value returned by realloc() rather than anything else.enami
2003-10-16safer use of reallocitojun
2003-08-07add TNF copyrightjdolecek
2003-08-07Move UCB-licensed code from 4-clause to 3-clause licence.agc
Patches provided by Joel Baker in PR 22365, verified by myself.
2003-06-27Pa Ar -> Ar.wiz
2003-04-09rename local macro blancmange() to SKIP_BLANKS(), to clarify whatjdolecek
it does and to better signal it might modify it's arguments fixes PR bin/20546 by Peter Seebach
2003-03-20this builds with WARNS=2jdolecek
2003-03-20get rid of one memmove() (not very significant)jdolecek
remove ()'s from error messages move some error checks immediatelly after appropriate realloc() calls
2003-02-25.Nm does not need a dummy argument ("") before punctuation orwiz
for correct formatting of the SYNOPSIS any longer.
2003-02-04"Utilize" has exactly the same meaning as "use," but it is moreperry
difficult to read and understand. Most manuals of English style therefore say that you should use "use".
2003-01-06compatibility, not compatiblity.wiz
2002-12-25make function merge() static in msort.cjdolecek
cosmetic change to how local variable is incremented (moved to for(;;))
2002-12-24improve previous slightly - need >= (not just >) in CHECKFSTACK()jdolecek
2002-12-24max_o in struct tempfile needs to be off_tjdolecek
use fseeko() rather than fseek() when changing file offset using max_o
2002-12-24put contents of extern.h directly to sort.h, and g/c extern.hjdolecek
de-__P()
2002-12-24g/c many_files(), toojdolecek
2002-12-24bump 'soft' limit for number of files to hard limit on startup; wejdolecek
want to be able to open as many temporary files as possible
2002-12-24make sure we don't attempt to write past end of fstack[], error out insteadjdolecek
this fixes second part ('tmpdir get smashed') of bin/18614 by Michael Graff
2002-12-24add extern definition for ncols and clist[] to sort.h, eliminate extrajdolecek
definitions in init.c and field.c g/c MAXMERGE
2002-12-24move fltab outside main and make it static, eliminate two memset()sjdolecek
g/c superfluous extern definition for clist[] and ncols make toutpath[] static
2002-12-23simplify a bit (no need for separate 'char *path')jdolecek
2002-11-27Remove the statically initialized "sigaction" structure completely becausetron
such usage is broken. Problem pointed out by Klaus Klein on "sources-changes@netbsd.org".
2002-11-27Add braces in a statically initialized "sigaction" structure to fix atron
build problem after siginfo(2) has been added.
2002-10-10g/c extern reference to toutpathjdolecek
2002-09-30Use the right file to output merge result.enami
2002-02-08Generate <>& symbolically. I'm avoiding .../dist/... directories for now.ross
2001-12-31Change some:thorpej
foo += sscanf(++foo, ...); constructs to: ++foo; foo += sscanf(foo, ...); to avoid the following warning from gcc 3.1: warning: operation on `pos' may be undefined
2001-12-08Punctuation nits, sort SEE ALSO.wiz
2001-05-15Only try to copy the extra incomplete record data if there is anythingjdolecek
actually read already. Albeit it's not damaging to copy zero data for bufend == crec->data case, the buffer end could also be between memory position 'crec' and 'crec->data'. Thus, we could end up with negative 'bufend - crec->data' value, and obvious havoc. This change fixes lib/12673, though the problem was masked and no longer repeatable with the provided example after the recent buffer size bump. The change was tested with the buffer size change backed off, and really fixes the problem in the PR.
2001-05-15fsort(): rearrange the push code to reduce one level of intendation,jdolecek
free keylist, buffer on end of work; no functional changes
2001-05-15Make compilable with -Wshadowjdolecek
2001-05-14disable the code which maxes nofiles limit, it should not be normallyjdolecek
needed now
2001-05-14Bump the initial record buffer size to 1MB and allow it to grow to 8MB,jdolecek
if needed and record count is within bounds (<MAXNUM), rather than sorting the input by 64KB chunks. This cuts the number of needed temporary files considerably (and improves performance, too). Slighly adjust some #defines, mostly to power of 2 values. This addresses bin/12673 and bin/12614, as well as complains from other people.
2001-04-30XXXross
For some reason this program wants to open _hundreds_ of temporary files. Make it setrlimit(RLIMIT_NOFILE, ...), so this rather dubious strategy at least works well enough to ctag(1) our own kernel. XXX
2001-03-16Add cross references for qsort(3), and radixsort(3), per PR 10567fair
2001-02-23Use MAXPATHLEN (which is 1024) instead of _POSIX_PATH_MAX (which is only 255).jdolecek
This change tracks change in rev 1.25 of sort.c by Christos Zoulas. While here, improve error messages slighly.
2001-02-22- use MAXPATHLEN (1024) instead of _POSIX_PATH_MAX (255) for the temporarychristos
path buffer - provide better error messages about why the temp file creation is failing - explicitly compare syscall return to -1 instead of < 0 and fdopen return to NULL instead of 0.
2001-02-21Fix problem when using sort >> foochristos
If no output file was specified sort fopened("/dev/stdout", "w"). This is *wrong* because "/dev/stdout" will truncate the output file, thus undoing the append effect the shell had set up. The simple fix here is to just arrange for outfp = stdout and don't play with /dev/stdout. While I am here: - KNF - make pattern for mkstemp have 6 X's.
2001-02-20fsort(): don't call append() with zero nelemjdolecek
This fixes the 'sort -f /dev/null' coredump reported on current-users.
2001-02-19Pull in various cosmetic changes from OpenBSD version of this manpage - mostlyjdolecek
whitespace changes, which don't influence the layout of result manpage at all, but also add -H to SYNOPSIS and state sort(1) appeared in v5, not v6 of AT&T Unix.
2001-02-19Pull up various cosmetic (mostly whitespace) changes from OpenBSD.jdolecek
This is primarily to ease syncing the two versions.
2001-02-19enterfield(): test the buffer size BEFORE assignment also for the other codejdolecek
branch, since we might get called with tablepos == endkey for some special input files (where an record would happen to fit exactly to the input buffer) - BTW, this bug looks like it has been here ~forever ... This seems to fix the sort crash for 'make british' build of ispell package, as reported by Mark White at current-users@.
2001-02-19enterkey():jdolecek
* move the test for keybuf size before keypos[-1] assignment, "just in case" * move the keypos assignment to improve readability
2001-02-19oops - wrong file, backoff local test changejdolecek
2001-02-19enterkey():jdolecek
* move the test for keybuf size before keypos[-1] assignment, "just in case" * move the keypos assignment to improve readability
2001-02-19cosmetic changes - make keylist[] static and remove extern definitionjdolecek
in fsort.h, move macro SALIGN() from sort.h to fsort.c
2001-02-19put tmp.c back to Makefile, toojdolecek
2001-02-19document -T and TMPDIR handlingjdolecek
resurrect ENVIRONMENT and FILES, adjust to be more correct slighly adjust SYNOPSIS line, so that it looks little nicer :)
2001-02-19full -T supportjdolecek