1
0
mirror of git://git.sv.gnu.org/coreutils.git synced 2026-04-10 06:03:31 +02:00
Commit Graph

69 Commits

Author SHA1 Message Date
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
Jim Meyering
04c2f73f6f Patch from Mike to fix handling of +x.yn. 1995-05-05 04:37:21 +00:00
Jim Meyering
f45ff2cfaf Don't hard-code /tmp.
[DEFAULT_TMPDIR]: Use this instead.
1995-05-05 04:16:12 +00:00
Jim Meyering
a3edacb315 (tempname): AND-off high bits of pid so that its decimal
string representation is no longer than five digits.
From Hans Verkuil (hans@wyst.hobby.nl)
1995-04-26 16:12:01 +00:00
Jim Meyering
80fab638f1 merge with 1.11.e 1995-03-21 03:50:10 +00:00
Jim Meyering
eba8aab7f2 add 1995 to Copyright dates 1995-03-09 22:20:59 +00:00
Jim Meyering
849868e342 (checkfp, mergefps): Use memcpy instead of bcopy.
(fillbuf): Use memmove instead of bcopy.
1995-01-28 13:04:27 +00:00
Jim Meyering
c5811b6a26 (main): Use safe_stat, not SAFE_STAT. 1994-12-20 04:03:28 +00:00
Jim Meyering
7323b7d9f2 Include "error.h" instead of simply declaring `void error ();'. 1994-12-16 05:42:47 +00:00
Jim Meyering
88442ad885 sort.c (main): Fix interpretation of field offsets when specified
via -k option.  They were being interpreted as zero-indexed.
POSIX says they are 1-based indices.
(keycompare): Don't ignore characters at the end of words
when otherwise they compare equal.  Both from Rik Faith
<faith@cs.unc.edu>.
1994-12-12 00:00:22 +00:00
Jim Meyering
f55a29ab93 (checkfp): Initialize keybeg and keylim fields.
Before, this command
  perl -e 'print join ("\n", (1..513)), "\n";'|sort -cs -n
failed on SunOS 4 systems.  From Robert H. de Vries <robert@and.nl>.
1994-12-02 16:54:56 +00:00
Jim Meyering
97f9755aeb (xfclose): Report failed fflush. Otherwise, failed write to stdout
could be missed because of subsequent clearerr.
(main): Include filename in a couple error messages.
Add missing %s in an error format string.
1994-12-02 16:49:47 +00:00