Commit Graph

17 Commits

Author SHA1 Message Date
jdolecek bf96399c09 initialize malloc()ated memory 2004-02-17 19:09:36 +00:00
itojun ba02466ff9 KNF (mostly whitespace) 2003-10-18 03:03:20 +00:00
itojun 50847da5c5 safer use of realloc 2003-10-16 06:56:17 +00:00
jdolecek f84513a754 add TNF copyright 2003-08-07 11:32:34 +00:00
agc 89aaa1bb64 Move UCB-licensed code from 4-clause to 3-clause licence.
Patches provided by Joel Baker in PR 22365, verified by myself.
2003-08-07 11:13:06 +00:00
jdolecek 8cf8af1c13 get rid of one memmove() (not very significant)
remove ()'s from error messages
move some error checks immediatelly after appropriate realloc() calls
2003-03-20 16:13:03 +00:00
jdolecek 63ae9a5e5f make function merge() static in msort.c
cosmetic change to how local variable is incremented (moved to for(;;))
2002-12-25 21:19:15 +00:00
jdolecek affba8f2e9 Pull up various cosmetic (mostly whitespace) changes from OpenBSD.
This is primarily to ease syncing the two versions.
2001-02-19 20:50:17 +00:00
jdolecek f65ee1b182 merge(): use array of buffers instead of one big buffer for all records, and
enlarge them as necessary to read records from merged files; the buffers
	are allocated once per program run, so there shouldn't be any
	performance difference
This makes sort(1) pass also regression 40B and should make it
fully arbitrary long record capable.
XXX the buffer array could probably be freed on end of fmerge() to save memory
2001-01-19 10:50:31 +00:00
jdolecek f2deab8a4c when merging stuff from several files, make merge handle records correctly
for stable sort so that the records are not swapped arbitrarily - this makes
in-tree BSD sort(1) pass regression test 38

while here, do couple of cleanups, like s/16/MERGE_FNUM/ where appropriate,
making local stuff static and some intendation/code format changes
2001-01-13 10:33:30 +00:00
jdolecek 1c216f18ea general cleanup of file list passing:
* get rid of union f_handle, replace by passing explicit int parameter
  and (new) struct filelist
* add new typedefs gen_func_t and put_func_t and use where appropriate
2001-01-11 14:05:24 +00:00
jdolecek fe7f0860c0 order(): since getline()/getnext() behaviour wrt passed
end pointer has changed (full buffer is used instead of first DEFLLEN bytes)
the end pointer cannot be shared for crec and prec, we need to pass
different value in each case
2000-10-17 15:16:27 +00:00
jdolecek ed1fd80898 constify, rename MAXLLEN to DEFLLEN 2000-10-16 21:42:21 +00:00
jdolecek 681fb9cb36 don't use register declarations 2000-10-15 20:46:33 +00:00
bjh21 e5218d1719 Two classes of changes from the initial OpenBSD commit of this sort(1):
FILE * variables are called "fp" rather than "fd".
Better (safer) temporary-file handling.
2000-10-07 20:37:06 +00:00
bjh21 6029888a3a Hit sort(1) with a hammer till it compiles.
Also add RCSIDs.
2000-10-07 18:37:09 +00:00
bjh21 1d5d9b5b60 4.4BSD-Lite2 contrib/sort 2000-10-07 16:39:34 +00:00