Age | Commit message (Collapse) | Author |
|
<http://mail.gnu.org/archive/html/bug-coreutils/2003-09/msg00008.html>.
(sort_buffer_size): Omit SIZE_BOUND arg. Compute the
size_bound ourselves. if an input file is a pipe and the user
specified a size, use that size instead of trying to guess the
pipe size. This has the beneficial side effect of avoiding the
overhead of default_sort_size in that case. All callers changed.
(sort): Remove static var size; now done by sort_buffer_size.
|
|
Similar fixes for many comments.
(TAB_DEFAULT): New constant, so that we can support NUL as
the field separator.
(tab): Now int, not char. Initialize to TAB_DEFAULT.
(specify_sort_size): If multiple sizes are specified, use the largest.
(begfield, limfield): Support NUL tab char.
(set_ordering): Do not let -i override -d.
(main): Report an error if incompatible -o or -t options are given.
Report an error for "-t ''". Allow "-t '\0'" to specify a NUL tab.
|
|
and for the indices to iterate through nsigs.
|
|
types and to remove unnecessary casts.
(min, max): Remove. All uses changed to MIN and MAX.
(hard_lc_collate, hard_LC_TIME, struct buffer.eof, struct
keyfield.skipsblanks, struct keyfield.skipeblanks, struct
keyfield.numeric, struct keyfield.general_numeric, struct
keyfield.month, struct keyfield.reverse, reverse, unique,
have_read_stdin): Now bool, not int. All uses changed.
(eolchar): Now char, not int.
(struct keyfield.ignore): Now bool const *, not int *.
(struct keyfield.translate): Now char const *, not char *.
(struct month.name): Likewise.
(blanks, nonprinting, nondictionary): Now bool[], not int[].
(cleanup, inittables, keycompare, check, mergefps, first_same_file,
check, sort, main): Use const * pointers when possible.
(month_cmp): Rewrite to avoid casts.
(inittables): Initialize tables unconditionally, to avoid branches.
(fillbuf): Return bool, not int. All uses changed.
(fillbuf, keycompare, new_key, main):
Use SIZE_MAX rather than (size_t) -1.
(trailing_blanks): Renamed from trim_trailing_blanks.
Return the number of blanks to trim. All uses changed.
(getmonth): Use trailing_blanks rather than open code.
(keycompare): Do not cast char * to unsigned char *; not needed.
CMP_WITH_IGNORE converts args to UCHAR, so no need to convert it
ourselves.
(compare, main): Use | rather than || to avoid jumps.
Replace "diff = NONZERO (alen)" with "diff = 1", since alen must
be nonzero there.
(check, first_same_file, sort, main):
Use bool instead of int local vars when possible.
(check): Merge the old 'checkfp' and 'check' into a single function,
that returns a boolean (true if the file was ordered).
All uses changed.
(main): Use int instead of unsigned for iterating through nsigs.
Rename local var "posix_pedantic" to "posixly_correct".
|
|
From Paul Eggert.
|
|
|
|
`bool'. Otherwise, at least one buggy compiler (alpha gcc-2.95.4)
would cause lines[-1 - swap] (with swap = false) to evaluate to
lines[4294967295].
|
|
|
|
the new sort algorithm requires just 1.5.
|
|
(mergelines, sortlines_temp): New functions.
(sortlines): Use them, to reduce the number of times that
we need to copy 'struct line' values. This improved CPU
performance by about 30% on one 18 MB test.
(sort): Don't invoke sortlines unless we have 2 or more lines.
|
|
Don't include closeout.h.
|
|
(main): Set exit_failure rather than calling close_stdout_set_status.
|
|
Now `sort --version' and `sort --help' fail, as they should
when their output is redirected to /dev/full.
|
|
(main): Set exit_failure, not xalloc_exit_failure and xmemcoll_exit_failure.
|
|
|
|
|
|
|
|
|
|
That would happen when invoked via: execl ("/usr/bin/sort", NULL);
|
|
xrealloc, and xcalloc return values and of xrealloc's first argument.
|
|
|
|
|
|
(main): Declare `nsigs' to be unsigned, not int.
|
|
to print large numbers simply.
|
|
end of the write buffer.
|
|
(fillbuf, keycompare): Cast literal `-1' to size_t in comparisons,
to avoid compiler warnings.
|
|
`#if HAVE_LANGINFO_CODESET', not `#if HAVE_LANGINFO_H'.
|
|
From Paul Eggert.
|
|
|
|
(hard_LC_COLLATE): Define even if ! ENABLE_NLS.
(main): Always initialize hard_LC_COLLATE.
Put initialization next to other locale-related stuff.
Include <langinfo.h> even if ! ENABLE_NLS.
(decimal_point, th_sep): Depend on HAVE_SETLOCALE, not ENABLE_NLS.
(main): Likewise.
(MONTHTAB_CONST): Remove; all uses removed.
(struct_month_cmp, inittables): Do not depend on ENABLE_NLS.
(main): hard_LC_TIME locale does not depend on ENABLE_NLS.
|
|
(usage): Document only the intersection of the old and new behaviors,
to encourage portability.
(short_options): Remove; no longer needed.
(COMMON_SHORT_OPTIONS): New macro.
(main): Parse options using POSIX 1003.1-2001 rules if
conforming to that standard. Do not warn of obsolete options.
|
|
support of obsolete "-N" option syntax in expand, head, fold,
split, tail, unexpand, uniq, and which prohibits options with
optional arguments in od and pr.
(main): Check for obsolete options.
(short_options): New constant.
|
|
Use xmemcoll instead of memcoll.
(die): Do not invoke cleanup; atexit does this now.
(main): Use atexit to invoke cleanup on exit.
Set xmemcoll_exit_failure to SORT_FAILURE.
|
|
between two size_t values can be stored in an int; this doesn't
work, for example, on 64-bit Solaris.
|
|
|
|
|
|
support of obsolete "+" option syntax in sort, tail, and uniq.
(usage, main): Implement this.
|
|
|
|
now preferred, as it connotes 1024) as well as 'k'.
|
|
HELP_OPTION_DESCRIPTION and VERSION_OPTION_DESCRIPTION.
|
|
instead of hard-coding --help and --version descriptions.
|
|
Split usage strings so that --help and --version descriptions are alone
in their own string.
Likewise for the one that says:
Mandatory arguments to long options are mandatory for short options too.
|
|
|
|
cpp directive that guards the use.
|
|
Use fputs, not printf.
|
|
That can cause problems (now documented in coreutils.texi).
|
|
``Mandatory arguments to long options are mandatory for short options too.\n\''
|
|
Instead, allocate at least sort_size bytes total.
|
|
`and'.
|
|
|