Age | Commit message (Collapse) | Author |
|
|
|
* src/wc.c (compute_number_width): Return right away if nfiles == 0.
|
|
contains a list of NUL-separated file names.
* src/wc.c: Include "readtokens.h".
(usage): Describe the new option, and adjust the `Usage':
with this option, no FILE may be specified on the command line.
(main): Handle the new option.
* tests/misc/wc-files0: New tests, for the above.
* tests/misc/wc-files0-from: Likewise.
* tests/misc/Makefile.am (TESTS): Add wc-files0.
|
|
If mbstate_t is not defined, then AC_TYPE_MBSTATE_T will define
it to `int' for us.
|
|
`defined mbstate_t' to detect missing support for mbstate_t.
The latter didn't work for HP-UX 11.23.
|
|
(wc_file): FILE might be null now.
(main): Simplify code a bit, so that fewer places need the setmode fixes.
|
|
|
|
|
|
|
|
|
|
|
|
(print_lines, print_words, print_chars, print_bytes, print_linelength,
have_read_stdin, wc, wc_file, main):
Use bool for booleans.
(exit_status): Remove.
(wc, wc_file): Return bool status. All callers changed.
|
|
|
|
(usage): Don't bother normalizing exit status
since the arg is already the correct exit status now.
|
|
whether it's leaked or not.
|
|
of 2003-09-19. Now, AUTHORS is a comma-separated list of strings.
Update the call to parse_long_options so that `AUTHORS, NULL' are the
last parameters.
* src/true.c (main): Append NULL to version_etc argument list.
* src/sys2.h (case_GETOPT_VERSION_CHAR): Likewise.
|
|
Begin each WRITTEN_BY string with `Written by ' and end it with `.'.
Mark each WRITTEN_BY string as translatable.
|
|
|
|
the call to parse_long_options so that `AUTHORS, NULL' are the last parameters.
|
|
|
|
Don't include closeout.h.
|
|
which caused the former to be used uninitialized if file_x was
nonzero.
|
|
invoked with a null pointer when there were no file arguments.
|
|
(wc): Rename `file' parameter.
Set new local, `file', to be the file name, or (when it's NULL)
_("standard output") so that all uses of `file' use the proper value.
Use STREQ, not strcmp.
|
|
(posixly_correct): Remove.
(struct fstatus): New struct.
(write_counts): Output fields of width number_width.
Do not worry about POSIXLY_CORRECT.
Use null file, not empty-string file, to denote stdin,
since "" is a valid file name on some hosts.
(wc, wc_file): New arg fstatus. Use it to avoid invoking fstat
if possible.
(wc): Avoid problems if end_pos - current_pos overflows.
Do not print odd message if stdin has a read error.
(get_input_fstatus, compute_number_width): New functions.
(main): Use them to implement the new behavior.
Ignore POSIXLY_CORRECT.
|
|
|
|
|
|
Use primitives from inttostr.h, not human.h, to print large numbers simply.
|
|
|
|
since it's already included from sys2.h via system.h.
|
|
`exit (1)' to `exit (EXIT_FAILURE)', and
`usage (1)' to `usage (EXIT_FAILURE)'.
|
|
|
|
|
|
|
|
the ASCII space character.
|
|
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.
|
|
Use fputs, not printf.
|
|
`and'.
|
|
|
|
(wc): Rename local `wc' to avoid shadowing function name.
|
|
a compilation error on Solaris 5.5.1 systems.
|
|
(iswprint, mbrtowc, wcwidth): Provide default definitions.
(total_bytes): New variable.
(print_bytes): New variable.
(longopts): Change abbreviation for --chars from 'c' to 'm'.
(usage): Update.
(write_counts): Add `bytes' argument.
(wc): New variables `bytes', `count_bytes', `count_chars',
`count_complicated'. The old code determines `bytes', not `chars'.
New case for MB_CUR_MAX > 1. A non-printable non-space character does
not increment the line position or start a word. Update `total_bytes'.
(main): Initialize `print_bytes' and `total_bytes' to 0. Accept 'm'
option. Pass `total_bytes' to write_counts.
|
|
|
|
(write_counts): Use it to select printf formats.
(main): Set posixly_correct from the POSIXLY_CORRECT envvar.
From Peter Moulder.
|
|
|
|
|
|
|
|
|