summaryrefslogtreecommitdiff
path: root/src/sort.c
AgeCommit message (Collapse)Author
1996-11-02.Jim Meyering
1996-11-02[!ENABLE_ASSERTIONS]: Guard NDEBUG definition.Jim Meyering
(checkfp): Fix off-by-one error that resulted in writing one byte beyond the end of a malloc'd buffer. It caused `sort -c' to segfault on Linux systems having a relatively recent libc. Before, running the command, perl -e "print 'x' x 30, \"\n\";"|sort -c would provoke the memory overrun (though not necessarily the failure). Add an assertion.
1996-11-01(key_init): New function.Jim Meyering
(main): Use key_init in the two places where it was open-coded.
1996-10-04(main): update --version output againJim Meyering
1996-09-23(keycompare): Declare translate to be unsigned char *.Jim Meyering
Otherwise, sign extension caused misordering when using e.g. -f.
1996-09-02(usage): Tell where to report bugs.Jim Meyering
1996-05-31(limfield): #ifdef-out a block of code that makesJim Meyering
GNU sort incompatible with Unix sort when a key-end spec refers to the N'th character in a field that has fewer than N characters. The POSIX spec doesn't appear to specify behavior for this case. From Karl Heuer.
1996-05-30(main): Use STDIN_FILENO instead of less portable fileno (stdin).Jim Meyering
1996-04-29(main): Give a better diagnostic for `sort -0'. Reported by Karl Berry.Jim Meyering
1996-04-24update Copyright years for 1996Jim Meyering
1996-03-24[SORT_FAILURE]: New macro.Jim Meyering
Be careful to exit with 1 only when -c is used and the input is not properly sorted. In all other cases, use SORT_FAILURE as required by POSIX. (main): Change some `error (1, ...' to use SORT_FAILURE. Upon successful termination, exit with EXIT_SUCCESS instead of `0'. Replace all uses of `2' (as exit code) with SORT_FAILURE.
1996-03-21(main): Declare to return int, not void. From Peter SeebachJim Meyering
<seebs@taniemarie.solon.com>.
1996-03-16Don't include version.h.Jim Meyering
(main): Use PACKAGE_VERSION instead of version_string.
1996-03-11(write_bytes): Renamed from xfwrite.Jim Meyering
Remove SIZE parameter. It was always 1. Update all callers. Rename NELEM parameter to N_BYTES and change its type to size_t.
1996-03-09(main): Initialize for internationalized message support: call setlocale,Jim Meyering
bindtextdomain, and textdomain.
1996-02-18Add -z option. Change all occurrences of '\n' to `eolchar'.Jim Meyering
(usage): Describe it. (main): Set eolchar to 0 for -z. From Mark W. Eichin <eichin@cygnus.com>.
1996-01-02(keycompare): Rewrite cases handling -i and -if to fix bug wherebyJim Meyering
non-ascii characters (supposed to be ignored with -i) were treated as significant. Reported by Carl Johnson <carlj@cjlinux.home.org>.
1995-12-05(main): Diagnose improper form of arguments to -k, then fail.Jim Meyering
1995-12-05(numcompare): Properly handle all cases in which signs differ. From Karl Heuer.Jim Meyering
1995-12-01treat `-' as if it were zero. Reported by Ross AlexanderJim Meyering
<r.alexander@auckland.ac.nz>.
1995-11-29(limfield): Remove field_start junk.Jim Meyering
Don't try to trim trailing blanks here -- it's not possible because we don't know where the field begins. Properly distinguish between cases where TAB character is specified and when the default is used. (trim_trailing_blanks): New function. (findlines): Call it. (keycompare): Likewise.
1995-11-28(begfield): Replace unnecessary loop with if-else.Jim Meyering
(limfield): Fix bug that made field specs like -k1.5 return a pointer into LINE beyond the first field. Rewrite to properly ignore trailing blanks. Replace unnecessary loop with if-else. (main): Don't decrement T2 corresponding to `x' in field specs like -ku.v,w.x.
1995-11-15Add support for sorting numbers in scientific notation.Jim Meyering
Include xstrtod.h. (struct keyfield): Add field: general_numeric. (usage): Describe -g option. (general_numcompare): New function. (keycompare): Use new comparison function when general_numeric flag is set. (set_ordering): Honor `g' flag. (main): Initialize and use new field. From Marcus Daniels <marcus@sysc.pdx.edu>.
1995-11-11(xmalloc): Declare static.Jim Meyering
(xrealloc): Likewise.
1995-10-26(main): Use xfopen, not xtmpopen to open final output file.Jim Meyering
1995-10-26(xtmpfopen): New function -- for opening temp files.Jim Meyering
Use it instead of xfopen.
1995-10-26(xfopen): Rewrite using open/fdopen in order to setJim Meyering
proper permissions on temporary files. Reported by Erik Corry (erik@kroete2.freinet.de).
1995-10-16Move struct dcls to precede dcls of file-scope variables.Jim Meyering
(monthtab, keyhead): Separate variable dcls from type dcls.
1995-10-16(usage): Move function definition to precede uses andJim Meyering
remove remove forward dcl. Protoize and add `const' attribute to dcls of lots of formals.
1995-10-04Test SA_INTERRUPT, not _POSIX_VERSION,Jim Meyering
to determine whether `sigaction' functions are available. Reported by Paul Nevai <nevai@ops.mps.ohio-state.edu>. Fix suggested by Karl Berry.
1995-09-19(checkfp): Rearrange loop to avoid duplicate test.Jim Meyering
Move a couple dcls from function scope into inner block.
1995-09-14(tempname): Replace `16' with a more readable expansion.Jim Meyering
Make sure that SEQ never exceeds 99999.
1995-09-14(sort): Rename local: ntemp -> n_temp_files, to avoid confusionJim Meyering
with another local, ntmp.
1995-08-08(mergefps) [lint]: Initialize SAVEALLOC to avoid spuriousJim Meyering
compiler warning. From Ulrich Drepper.
1995-08-07Annotate localizable strings with _(...). From Franc,ois.Jim Meyering
1995-07-30(check): Print `disorder on...' message on standard error, not stdout.Jim Meyering
This is a minor concession to POSIX which says `no output shall be produced'. (main): Fix -k so it works. -k 2,3 was being treated like -k 2. Reported by Marcus Daniels <marcus@sysc.pdx.edu>.
1995-07-12(main): Comment out unreachable break stmt.Jim Meyering
1995-07-09(main): Add UCHAR casts.Jim Meyering
1995-07-09(main): When using obsolescent +pos -pos syntax, allowJim Meyering
omission of field spec only when character offset is specified. Otherwise, -. +. would be accepted.
1995-07-09(main): Allow field spec, M, to be omitted in +M.N or -M.NJim Meyering
position specification. Omitting M is equivalent to specifying `0' for M. From Rick Sladkey (jrs@world.std.com).
1995-06-24Undefine min and/or max before defining to avoid redefinition warningJim Meyering
on systems.
1995-06-18merge with 1.12Jim Meyering
1995-06-13(xfclose): Don't try to flush stdin, only stdout.Jim Meyering
Otherwise, at least Ultrix-4.3's fflush would return EOF. Reported by Jim Blandy (jimb@cyclic.com).
1995-05-13(usage): Include one- or two-line synopsis in --help output.Jim Meyering
From Karl Berry.
1995-05-05(main): Use stat, not safe_stat. The latter was unnecessary.Jim Meyering
1995-05-05Patch from Mike to fix handling of +x.yn.Jim Meyering
1995-05-05Don't hard-code /tmp.Jim Meyering
[DEFAULT_TMPDIR]: Use this instead.
1995-04-26(tempname): AND-off high bits of pid so that its decimalJim Meyering
string representation is no longer than five digits. From Hans Verkuil (hans@wyst.hobby.nl)
1995-03-21merge with 1.11.eJim Meyering
1995-03-09add 1995 to Copyright datesJim Meyering