| Age | Commit message (Collapse) | Author |
|
|
|
|
|
conditional around __RCSID, lint can handle that fine.
|
|
|
|
Use 1's compliment for -ve numbers to avoid confitionals.
|
|
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.
|
|
|
|
|
|
- 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.
|
|
Simplify logic for reading input records.
Do a merge sort whenever we have 16 partial sorted blocks.
The patient is breathing, but still carrying a lot of extra weight.
|
|
almost always need one.
But do ADD it, instead of overwriting the last byte of the last key since
that may be requesting the other end of the sort order.
There is no need to check for space for the line after adding the key,
but we might as well check before - just to optimise that case.
This might fix some of the sort bugs - but not the one I'm looking at!
|
|
structure that used it.
Pass end of keybuf area, not size to enterkey() - largely to remove a
variable who'se use isn't obvious from the name!
The structute of this code sucks.
|
|
I'm looking at fixing the 'sort -n' fubars, but this code is an
inpeneterable mess - which needs some fixing first!
|
|
|
|
|
|
to not lose on i386 because another buffer appears immediately following.
Regress tests all passed.
|
|
properly with -n
fixes PR bin/20259 by Giles Lean, PR bin/20542 by Peter Seebach, and
part of PR bin/24316 by MLH
|
|
|
|
|
|
|
|
Patches provided by Joel Baker in PR 22365, verified by myself.
|
|
it does and to better signal it might modify it's arguments
fixes PR bin/20546 by Peter Seebach
|
|
definitions in init.c and field.c
g/c MAXMERGE
|
|
This is primarily to ease syncing the two versions.
|
|
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@.
|
|
* move the test for keybuf size before keypos[-1] assignment, "just in case"
* move the keypos assignment to improve readability
|
|
|
|
|
|
is used for sort - this makes sort pass regression test number 36
while here, slighly adjust code formating on couple of places
|
|
|
|
|
|
Also add RCSIDs.
|
|
|