I installed this patch to coreutils to bring back support for commonly
used commands like tail -10 even when conforming to POSIX.1-2001, as
a compatible extension to POSIX. There are still a few remaining
trouble spots (see the NEWS patch below) but most of the problems
should be resolved to everyone's satisfaction. Thanks to everyone who
pushed the POSIX committee (and me :-) to get this matter clarified
and resolved.
2005-04-26 Paul Eggert [EMAIL PROTECTED]
Restore support for usages like head -1 and tail -1,
even when conforming to POSIX 1003.1-2001.
Fix bug with POSIXLY_CORRECT=1 fold file -3.
join now supports a NUL field separator, e.g., join -t '\0'.
join now detects and reports incompatible options, e.g.,
join -t x -t y,
* NEWS: Document this.
* doc/coreutils.texi (Standards conformance): Do not mention head -10,
since it now works the same regardless of POSIX version.
(od invocation): -w N - -w[N].
(pr invocation): -S STRING - -SSTRING.
(fold invocation): -WIDTH works even when conforming to POSIX
1003.1-2001.
(head invocation, tail invocation): Likewise for -NUM.
(split invocation): Likewise for -LINES.
(uniq invocation): Likewise for -N.
(expand invocation, unexpand invocation): Likewise for -TAB.
(nice invocation): Likewise for -ADJUSTMENT.
(sort invocation): Clarify explanation of +N option.
(uniq invocation): Likewise.
(join invocation): Remove special case for --help, --version.
(touch invocation): Clarify explanation of date options.
(Options for date): -I timespec - -I[timespec].
* src/date.c: Remove posixver.h and its uses.
(COMMON_SHORT_OPTIONS): Remove.
(short_options): New constant.
(short_options, usage): -I now always takes an optional arg.
* src/expand.c: Remove posixver.h and its uses.
(shortopts): New constant. -DIGIT now always takes an optional arg.
(main): Revamp parsing of -DIGIT to let parse_tab_stops handle it.
Don't complain about -DIGIT.
* src/fold.c: Remove posixver.h and its uses.
(shortopts): New constant. -DIGIT now always takes an optional arg.
(main): Don't preprocess arg list; that was buggy. Use method
similar to expand.
* src/head.c: Remove posixver.h and its uses.
(header_mode_option): Remove.
(main): Don't complain about obsolete -NUM args.
* src/join.c: Remove posixver.h and its uses.
(obsolete_usage): Remove.
(join_field_1, join_field_2): Initialize to SIZE_MAX to indicate
they haven't been set yet.
(tab): Now int, not char. Initialize to -1 to indicate white space
separates columns, so that we can use NUL as a separator.
All uses changed.
(OBSOLETE_LONG_OPTIONS, get_option): Remove.
(string_to_join_field): Remove ERR_MSG_FMT arg; a single format
suffices. Use xstrtoul for sizes; it suffices.
(decode_field_spec): Report an error and exit on failure. Return void,
not bool.
(add_field_list): Likewise.
(set_join_field): New function.
(enum operand_status): New enum.
(add_file_name): New args OPERAND_STATUS, JOPTION_COUNT,
PREV_OPTC_STATUS, OPTC_STATUS to handle the bewildering array of
possibilities with obsolete option parsing.
(main): Use it. Do not depend on POSIX version.
Check for conflicting options. Parse obsolete options -j1 and -j2
so that it is a pure extension to POSIX 1003.1-2001.
Allow '-t\0' to specify a NUL tab, stealing the code from 'sort'.
* src/nice.c: Remove posixver.h and its uses.
(main): Always support -NUM option.
* src/od.c: Remove posixver.h and its uses.
(short_options): New constant, which always supports -w[num].
(COMMON_SHORT_OPTIONS): Remove.
* src/pr.c: Remove posixver.h and its uses.
(short_options): New constant, which always supports -S[string].
(COMMON_SHORT_OPTIONS): Remove.
* src/sort.c: Remove posixver.h and its uses.
(short_options): New constant, which always supports -y arg.
(COMMON_SHORT_OPTIONS): Remove.
(main): Redo workaround for Solaris compatibility with -y.
This change isn't visible to the user; it just cleans up the
code so that we don't need posixver.h.
* src/split.c: Remove posixver.h and its uses.
(main): Don't complain about -NUM option.
* src/tail.c (parse_obsolete_option): Don't complain about -NUM.
* src/unexpand.c: Remove posixver.h and its uses.
(main): Don't complain about -TAB.
* src/uniq.c (main): Don't complain about -NUM.
Index: NEWS
===
RCS file: /fetish/cu/NEWS,v
retrieving revision 1.278