Jim Meyering [Sat, 16 Feb 2002 07:31:27 +0000 (07:31 +0000)]
Include posixver.h.
(usage): Document only the intersection of the old and new behaviors,
to encourage portability.
(main): Revert to previous behavior, except report
an error and exit if the obsolete syntax is used and if conforming
to the new standard.
Jim Meyering [Sat, 16 Feb 2002 07:29:18 +0000 (07:29 +0000)]
Include posixver.h.
(usage): Document only the intersection of the old and new behaviors,
to encourage portability.
(shortopts): Remove; no longer needed.
(main): Revert to previous behavior, except report
an error and exit if the obsolete syntax is used and if conforming
to the new standard.
Jim Meyering [Tue, 12 Feb 2002 15:44:16 +0000 (15:44 +0000)]
Include "dirname.h".
(outbase): Now a global var.
(outfile_end): Remove.
(suffix_length): New var.
(shortopts, longopts, main): Add -a or --suffix-length.
(next_file_name): Implement -a. Do not extend the suffix length.
Check for file names that are too long.
(main): Move outfile initialization to next_file_name.
Jim Meyering [Mon, 11 Feb 2002 23:25:34 +0000 (23:25 +0000)]
Add more support for POSIX 1003.1-2001, which requires removal
for support of obsolete "-DIGITS" option syntax in nice, and
which prohibits options with optional arguments like date's
-I option.
Jim Meyering [Mon, 11 Feb 2002 23:23:42 +0000 (23:23 +0000)]
(main): Conform to POSIX 1003.1-2001 if
POSIX2_VERSION says to, otherwise warn of obsolete usage if
OBSOLETE_OPTION_WARNINGS is nonzero and if not POSIXLY_CORRECT.
Jim Meyering [Mon, 11 Feb 2002 22:58:59 +0000 (22:58 +0000)]
Add more support for POSIX 1003.1-2001, which requires removal
for support of obsolete "-DIGITS" option syntax in nice, and
which prohibits options with optional arguments like date's
-I option.
(ISO_8601_OPTION): New enum value.
(long_options): Use it.
(short_options): New constant.
(usage): Document the change.
(main): Conform to POSIX 1003.1-2001 if
POSIX2_VERSION says to, otherwise warn of obsolete usage if
OBSOLETE_OPTION_WARNINGS is nonzero and if not POSIXLY_CORRECT.
Jim Meyering [Mon, 11 Feb 2002 15:11:05 +0000 (15:11 +0000)]
Add more support for POSIX 1003.1-2001, which requires removal for
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.
Jim Meyering [Mon, 11 Feb 2002 14:28:35 +0000 (14:28 +0000)]
2002-02-02 Paul Eggert <eggert@twinsun.com>
Bruno Haible <bruno@clisp.org>
* unicodeio.c (unicode_to_mb): New function, extracted from
print_unicode_char. Call failure callback instead of error.
(fwrite_success_callback): New function.
(exit_failure_callback): New function.
(fallback_failure_callback): New function.
(print_unicode_char): Call unicode_to_mb.
Jim Meyering [Mon, 11 Feb 2002 14:28:09 +0000 (14:28 +0000)]
2002-02-02 Paul Eggert <eggert@twinsun.com>
Bruno Haible <bruno@clisp.org>
* unicodeio.c (unicode_to_mb): New function, extracted from
print_unicode_char. Call failure callback instead of error.
(fwrite_success_callback): New function.
(exit_failure_callback): New function.
(fallback_failure_callback): New function.
(print_unicode_char): Call unicode_to_mb.
Jim Meyering [Mon, 11 Feb 2002 11:00:00 +0000 (11:00 +0000)]
(head_lines): If we have read too much data, try
to seek back to the position we would have gotten to had we
been reading one byte at a time. POSIX currently doesn't
require this, but it's easy to do and some software relies on it.
Jim Meyering [Sat, 2 Feb 2002 09:53:26 +0000 (09:53 +0000)]
Add more support for POSIX 1003.1-2001, which requires removal for
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.
(usage): Document this.
(shortopts): New constant.
(main): Check for obsolete options.
Jim Meyering [Sat, 2 Feb 2002 09:47:57 +0000 (09:47 +0000)]
Add more support for POSIX 1003.1-2001, which requires removal for
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.
(usage): Document this.
(shortopts): New constant.
(main): Check for obsolete options.
Jim Meyering [Sat, 2 Feb 2002 09:40:50 +0000 (09:40 +0000)]
Add more support for POSIX 1003.1-2001, which requires removal for
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.
(usage): Document this.
(main): Check for obsolete options.
(shortopts): New constant.
(main): Use -1, not EOF, for getopt_long.
Jim Meyering [Sat, 2 Feb 2002 09:37:12 +0000 (09:37 +0000)]
Add more support for POSIX 1003.1-2001, which requires removal for
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.
Jim Meyering [Sat, 2 Feb 2002 09:35:43 +0000 (09:35 +0000)]
Add more support for POSIX 1003.1-2001, which requires removal for
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.
(usage): Document it.
(main): Check for obsolete options.
(short_options): New constant.
(SEP_STRING_OPTION): New enum value.
(long_options): Use it.
Jim Meyering [Sat, 2 Feb 2002 09:31:09 +0000 (09:31 +0000)]
Add more support for POSIX 1003.1-2001, which requires removal for
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.
(usage): Document it.
(main): Check for obsolete options.
(short_options): New constant.
New enum for long options.
Jim Meyering [Sat, 2 Feb 2002 08:10:04 +0000 (08:10 +0000)]
Add more support for POSIX 1003.1-2001, which requires removal for
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.
(usage): Document it.
(main): Check for obsolete options.
(header_mode_option): New constant.
Jim Meyering [Sat, 2 Feb 2002 07:58:50 +0000 (07:58 +0000)]
Add more support for POSIX 1003.1-2001, which requires removal for
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.
(main): Fix bug: -- -N was treated as -N --.
Jim Meyering [Sat, 2 Feb 2002 07:54:49 +0000 (07:54 +0000)]
Add more support for POSIX 1003.1-2001, which requires removal for
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.
(shortopts): New constant.
(main): Check for obsolete options.
Jim Meyering [Fri, 1 Feb 2002 23:43:46 +0000 (23:43 +0000)]
* src/shred.c: (VERBOSE_UPDATE): Update every 5 seconds, not every 10.
(wipename): Quote file names only when necessary.
(main): Copy quoted string into malloc'd storage so it doesn't
get clobbered when using -u and --verbose.
Minor clean-up.
* src/shred.c:
Use `NULL' rather than `(time_t *) 0'.
(dopass): Use STREQ in place of strcmp.
Add parentheses around use of nested ternary operator.
Jim Meyering [Fri, 1 Feb 2002 23:34:57 +0000 (23:34 +0000)]
(VERBOSE_UPDATE): Now counts seconds, not bytes.
(dopass): If verbose, output a line every VERBOSE_UPDATE seconds,
and suppress duplicate output lines. Output a percentage as well
as a count of bytes.
Also, fix comment/code typo regarding how many bytes have been
written; this typo was harmless before, but is no longer harmless with
the above change in effect.
Jim Meyering [Fri, 1 Feb 2002 16:31:55 +0000 (16:31 +0000)]
Add more support for POSIX 1003.1-2001, which requires removal for
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.
Jim Meyering [Sun, 27 Jan 2002 07:53:37 +0000 (07:53 +0000)]
tail -n +2 would perform an extra read after encountering EOF
(start_lines): Detect EOF, inform caller.
(tail_lines): Upon EOF in start_lines, return immediately.