History log of /netbsd/usr.bin/sort/init.c (Results 1 – 25 of 30)
Revision Date Author Comments
# e2b57c28 19-Sep-2021 andvar <andvar@NetBSD.org>

fix few more typos in comments, messages and documentation.


# ed7f0ec9 18-Oct-2013 christos <christos@NetBSD.org>

fix unused variable warnings


# d499a42b 18-Dec-2010 christos <christos@NetBSD.org>

Add an 'l' style for sorting that sorts by the string length of the field.


# 90abead5 06-Jun-2010 wiz <wiz@NetBSD.org>

Fix typo in comment.


# fcf4d3f7 05-Jun-2010 dholland <dholland@NetBSD.org>

Rework previous change to fixit() to not trip on option arguments. (Noticed
by wiz.) Clarify the loop logic involved.


# b6360c7f 27-May-2010 dholland <dholland@NetBSD.org>

Don't recognize "+3" after -- or after the first non-option argument.
This prevents converting "+3" into "-k4.1" in places where getopt
won't recognize it, which in turn prevents silly error messages

Don't recognize "+3" after -- or after the first non-option argument.
This prevents converting "+3" into "-k4.1" in places where getopt
won't recognize it, which in turn prevents silly error messages and
lossage trying to sort files whose names begin with +. PR 43358.

show more ...


# 2b8a0536 06-Nov-2009 joerg <joerg@NetBSD.org>

Retire __SCCSID. It has only archeological value now. Also retire lint
conditional around __RCSID, lint can handle that fine.


# 1310aa04 10-Sep-2009 dsl <dsl@NetBSD.org>

Save length of key instead of relying of the weight of the record sep.
This frees a byte value to use for 'end of key' (to correctly sort
short keys) while still having a weight assigned to the field

Save length of key instead of relying of the weight of the record sep.
This frees a byte value to use for 'end of key' (to correctly sort
short keys) while still having a weight assigned to the field sep.
(Unless -t is given, the field sep is in the field data.)
Do reverse sorts by writing the output file in reverse order (rather
than reversing the sort - apart from merges).
All key compares are now unweighted.
For 'sort -u' mark duplicates keys during the sort and don't write
to the output.
Use -S to mean a posix sort - where equal keys are sorted using the
raw record (rather than being kept in the original order).
For 'sort -f' (no keys) generate a key of the folded data (as for -n
-i and -d), simplifies the code and allows a 'posix' sort.

show more ...


# 4611f32c 05-Sep-2009 dsl <dsl@NetBSD.org>

Include a local copy of the sradixsort() code from libc.
Currently unchanged apart from the deletion of the 'unstable' version and
other unneeded code.
Use fldtab[0]. not fldtab-> when we are referri

Include a local copy of the sradixsort() code from libc.
Currently unchanged apart from the deletion of the 'unstable' version and
other unneeded code.
Use fldtab[0]. not fldtab-> when we are referring to the global info
in the 0th entry to emphasise that this entry is different.
fldtab[0].weights is only needed in the SINGL_FLD case - so set it there.
Re-indent a big 'if' is setfield() so that the line breaks match the
logic - which looks dubious now!

show more ...


# 5c6e557c 22-Aug-2009 dsl <dsl@NetBSD.org>

<space> and <tab> at the start of key fields are supposed to be sorted
as if part of the data.
This is a bit fubar since we need a value than sorts before any byte value
as a key field separator - so

<space> and <tab> at the start of key fields are supposed to be sorted
as if part of the data.
This is a bit fubar since we need a value than sorts before any byte value
as a key field separator - so need 257 byte values (since radixsort() doesn't
take a length for each record).
For now map '\t' to 0x01 and hope no one will notice!

show more ...


# 7b4a02be 22-Aug-2009 dsl <dsl@NetBSD.org>

Rework the way sort generates sort keys:
- If we generate a key, it is always sortable using memcmp()
- If we are sorting the whole record, then a weight-table must be used
during compares.
- Major

Rework the way sort generates sort keys:
- If we generate a key, it is always sortable using memcmp()
- If we are sorting the whole record, then a weight-table must be used
during compares.
- Major surgery to encoding of numbers to ensure unique keys for equal
numeric values. Reverse numerics are handled by inverting the sign.
- Case folding (-f) is handled when the sort keys are generated. No other
code has to care at all.
- Key uniqueness (-u) is done during merge for large datasets. It only
has to be done when writing the output file for small files.
Since the file is in key order this is simple!
Probably fixes all of: PR/27257 PR/25551 PR/22182 PR/31095 PR/30504
PR/36816 PR/37860 PR/39308
Also PR/18614 should no longer die, but a little more work needs to be
done on the merging for very large files.

show more ...


# 2a0ab276 15-Aug-2009 dsl <dsl@NetBSD.org>

Ansify.
I'm looking at fixing the 'sort -n' fubars, but this code is an
inpeneterable mess - which needs some fixing first!


# ce099b40 28-Apr-2008 martin <martin@NetBSD.org>

Remove clause 3 and 4 from TNF licenses


# d1de6042 23-Oct-2006 jdolecek <jdolecek@NetBSD.org>

fix check for field order to allow .0 form in "-k 1.2,1.0"

fix provided in PR bin/25572 by Ross Patterson


# e219d781 03-Nov-2004 dsl <dsl@NetBSD.org>

Add (unsigned char) cast to ctype functions


# de243242 18-Feb-2004 jdolecek <jdolecek@NetBSD.org>

insertcol() may insert up to two items to clist, so allocate memory accordingly
this fixes sort regression test 28A and 28B


# c8e0ab67 17-Feb-2004 jdolecek <jdolecek@NetBSD.org>

fix parsing of some +POS -POS variants, as pointed out by sort regression
tests


# 909cd63c 17-Feb-2004 itojun <itojun@NetBSD.org>

safer realloc idiom
minor knf


# 9f774323 15-Feb-2004 jdolecek <jdolecek@NetBSD.org>

remove compile-time limit on number of -k options, allocate necessary
structures as-needed


# 87c48f11 15-Feb-2004 jdolecek <jdolecek@NetBSD.org>

rewrite fixit() to duplicate less code, and comment the contents better;
also removes compile-time dependancy on ND constant


# afac62bc 15-Feb-2004 jdolecek <jdolecek@NetBSD.org>

g/c redundant setfield() prototype
clear setcolumn() somewhat - use strtol() instead of sscanf(), and
simplify flag setting code


# f84513a7 07-Aug-2003 jdolecek <jdolecek@NetBSD.org>

add TNF copyright


# 89aaa1bb 07-Aug-2003 agc <agc@NetBSD.org>

Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22365, verified by myself.


# 9208bb6e 24-Dec-2002 jdolecek <jdolecek@NetBSD.org>

add extern definition for ncols and clist[] to sort.h, eliminate extra
definitions in init.c and field.c
g/c MAXMERGE


# 2aa37f4a 31-Dec-2001 thorpej <thorpej@NetBSD.org>

Change some:

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


12