Jim Meyering
952a4436eb
(fraccompare): Add explicit int' in register' dcl, to
...
avoid new warning from gcc.
1996-11-27 05:05:52 +00:00
Jim Meyering
0d43bad18e
(set_ordering): Revert 1994-05-04 change to this function
...
so that blanks are not unconditionally ignored when computing start
and end positions for numeric keys. Reported by Markus Demleitner.
1996-11-25 03:07:52 +00:00
Jim Meyering
e298f1f300
(usage): Alphabetize options like sort -f would.
1996-11-23 22:06:55 +00:00
Jim Meyering
5582e6dad3
change bug-reporting address
1996-11-03 03:16:27 +00:00
Jim Meyering
b8e689dc67
change bug-reporting address
1996-11-02 20:44:15 +00:00
Jim Meyering
950325ee23
.
1996-11-02 05:14:21 +00:00
Jim Meyering
febf70b73f
[!ENABLE_ASSERTIONS]: Guard NDEBUG definition.
...
(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-02 03:47:04 +00:00
Jim Meyering
24e88142ba
(key_init): New function.
...
(main): Use key_init in the two places where it was open-coded.
1996-11-01 00:08:58 +00:00
Jim Meyering
2c035a7cfd
(main): update --version output again
1996-10-04 04:28:35 +00:00
Jim Meyering
85cddd3119
(keycompare): Declare translate to be unsigned char *.
...
Otherwise, sign extension caused misordering when using e.g. -f.
1996-09-23 03:02:04 +00:00
Jim Meyering
c609ba2d13
(usage): Tell where to report bugs.
1996-09-02 15:34:25 +00:00
Jim Meyering
3c467c0d22
(limfield): #ifdef-out a block of code that makes
...
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-31 03:07:45 +00:00
Jim Meyering
3bd31fac90
(main): Use STDIN_FILENO instead of less portable fileno (stdin).
1996-05-30 00:59:50 +00:00
Jim Meyering
30f76e827e
(main): Give a better diagnostic for `sort -0'. Reported by Karl Berry.
1996-04-29 01:35:18 +00:00
Jim Meyering
59d334f4d4
update Copyright years for 1996
1996-04-24 04:50:53 +00:00
Jim Meyering
e6fae6c23f
[SORT_FAILURE]: New macro.
...
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-24 02:26:21 +00:00
Jim Meyering
dd5db06467
(main): Declare to return int, not void. From Peter Seebach
...
<seebs@taniemarie.solon.com >.
1996-03-21 13:00:15 +00:00
Jim Meyering
4229a555fc
Don't include version.h.
...
(main): Use PACKAGE_VERSION instead of version_string.
1996-03-16 22:30:54 +00:00
Jim Meyering
6526b37460
(write_bytes): Renamed from xfwrite.
...
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-11 22:07:21 +00:00
Jim Meyering
715765a548
(main): Initialize for internationalized message support: call setlocale,
...
bindtextdomain, and textdomain.
1996-03-09 20:19:13 +00:00
Jim Meyering
1f37d82ce4
Add -z option. Change all occurrences of '\n' to `eolchar'.
...
(usage): Describe it.
(main): Set eolchar to 0 for -z.
From Mark W. Eichin <eichin@cygnus.com >.
1996-02-18 00:55:08 +00:00
Jim Meyering
360b2870d8
(keycompare): Rewrite cases handling -i and -if to fix bug whereby
...
non-ascii characters (supposed to be ignored with -i) were treated
as significant. Reported by Carl Johnson <carlj@cjlinux.home.org >.
1996-01-02 06:10:39 +00:00
Jim Meyering
e625640bd0
(main): Diagnose improper form of arguments to -k, then fail.
1995-12-05 23:50:43 +00:00
Jim Meyering
5cf455d736
(numcompare): Properly handle all cases in which signs differ. From Karl Heuer.
1995-12-05 17:53:39 +00:00
Jim Meyering
74b4707ea6
treat `-' as if it were zero. Reported by Ross Alexander
...
<r.alexander@auckland.ac.nz >.
1995-12-01 07:03:47 +00:00
Jim Meyering
2f077ef41f
(limfield): Remove field_start junk.
...
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-29 22:51:04 +00:00
Jim Meyering
da8c36f53f
(begfield): Replace unnecessary loop with if-else.
...
(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-28 20:07:17 +00:00
Jim Meyering
34fc818d7e
Add support for sorting numbers in scientific notation.
...
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-15 21:42:47 +00:00
Jim Meyering
cc7705fe6f
(xmalloc): Declare static.
...
(xrealloc): Likewise.
1995-11-11 21:46:32 +00:00
Jim Meyering
b9485b8d52
(main): Use xfopen, not xtmpopen to open final output file.
1995-10-26 13:20:25 +00:00
Jim Meyering
66b9285a6f
(xtmpfopen): New function -- for opening temp files.
...
Use it instead of xfopen.
1995-10-26 13:19:10 +00:00
Jim Meyering
039942bfc1
(xfopen): Rewrite using open/fdopen in order to set
...
proper permissions on temporary files. Reported by Erik Corry
(erik@kroete2.freinet.de ).
1995-10-26 05:14:41 +00:00
Jim Meyering
45d4def5e4
Move struct dcls to precede dcls of file-scope variables.
...
(monthtab, keyhead): Separate variable dcls from type dcls.
1995-10-16 14:45:09 +00:00
Jim Meyering
b9c1393e5f
(usage): Move function definition to precede uses and
...
remove remove forward dcl.
Protoize and add `const' attribute to dcls of lots of formals.
1995-10-16 14:38:11 +00:00
Jim Meyering
a9de4d485a
Test SA_INTERRUPT, not _POSIX_VERSION,
...
to determine whether `sigaction' functions are available.
Reported by Paul Nevai <nevai@ops.mps.ohio-state.edu >.
Fix suggested by Karl Berry.
1995-10-04 03:46:35 +00:00
Jim Meyering
c253d247ca
(checkfp): Rearrange loop to avoid duplicate test.
...
Move a couple dcls from function scope into inner block.
1995-09-19 12:50:34 +00:00
Jim Meyering
b23b6bbcf7
(tempname): Replace `16' with a more readable expansion.
...
Make sure that SEQ never exceeds 99999.
1995-09-14 13:31:52 +00:00
Jim Meyering
800e219a2d
(sort): Rename local: ntemp -> n_temp_files, to avoid confusion
...
with another local, ntmp.
1995-09-14 13:09:27 +00:00
Jim Meyering
f03f8dcc44
(mergefps) [lint]: Initialize SAVEALLOC to avoid spurious
...
compiler warning. From Ulrich Drepper.
1995-08-08 04:58:46 +00:00
Jim Meyering
92c50e7f52
Annotate localizable strings with _(...). From Franc,ois.
1995-08-07 14:57:29 +00:00
Jim Meyering
f2fc6e4cad
(check): Print `disorder on...' message on standard error, not stdout.
...
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-30 05:02:37 +00:00
Jim Meyering
37ba8d9867
(main): Comment out unreachable break stmt.
1995-07-12 03:06:49 +00:00
Jim Meyering
51c3164ba3
(main): Add UCHAR casts.
1995-07-09 17:06:41 +00:00
Jim Meyering
6dfad5e900
(main): When using obsolescent +pos -pos syntax, allow
...
omission of field spec only when character offset is specified.
Otherwise, -. +. would be accepted.
1995-07-09 16:42:31 +00:00
Jim Meyering
ccfb7f032d
(main): Allow field spec, M, to be omitted in +M.N or -M.N
...
position specification. Omitting M is equivalent to specifying `0'
for M. From Rick Sladkey (jrs@world.std.com ).
1995-07-09 02:25:11 +00:00
Jim Meyering
86671a4ed0
Undefine min and/or max before defining to avoid redefinition warning
...
on systems.
1995-06-24 21:10:12 +00:00
Jim Meyering
6ebaf82426
merge with 1.12
1995-06-18 19:33:31 +00:00
Jim Meyering
1aa5954b42
(xfclose): Don't try to flush stdin, only stdout.
...
Otherwise, at least Ultrix-4.3's fflush would return EOF.
Reported by Jim Blandy (jimb@cyclic.com ).
1995-06-13 04:46:12 +00:00
Jim Meyering
7cdc7a0bd9
(usage): Include one- or two-line synopsis in --help output.
...
From Karl Berry.
1995-05-13 18:34:54 +00:00
Jim Meyering
a5da850f3f
(main): Use stat, not safe_stat. The latter was unnecessary.
1995-05-05 05:03:50 +00:00