summaryrefslogtreecommitdiff
path: root/src/wc.c
AgeCommit message (Collapse)Author
2003-07-23(wc): Fix typo in computation of file from file_x,Jim Meyering
which caused the former to be used uninitialized if file_x was nonzero.
2003-07-20(get_input_fstatus): Fix typo: `stat' was beingJim Meyering
invoked with a null pointer when there were no file arguments.
2003-07-20(write_counts): Add a comment.Jim Meyering
(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.
2003-07-20(number_width): New var.Jim Meyering
(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.
2003-06-17(main): Call initialize_main.Jim Meyering
2003-06-12(usage): Correct wording: wc prints counts in the order `newline, word, byte'.Jim Meyering
2002-11-05(write_counts, wc):Jim Meyering
Use primitives from inttostr.h, not human.h, to print large numbers simply.
2002-10-09(wc): Adapt to new safe_read ABI.Jim Meyering
2002-09-22Remove all inclusions of inttypes.h,Jim Meyering
since it's already included from sys2.h via system.h.
2002-08-31Change `exit (0)' to `exit (EXIT_SUCCESS)',Jim Meyering
`exit (1)' to `exit (EXIT_FAILURE)', and `usage (1)' to `usage (EXIT_FAILURE)'.
2002-08-25(main): Close STDIN_FILENO rather than a literal `0'.Jim Meyering
2002-07-02(usage): Use the PACKAGE_BUGREPORT e-mail address, rather than hard-coding it.Jim Meyering
2002-04-25(usage): Adjust ordering to match that of default output.Jim Meyering
2001-12-13(wc): Use ISSPACE and iswspace in addition to hard-codingJim Meyering
the ASCII space character.
2001-12-01Reflect renaming to, and new usage of these macros:Jim Meyering
HELP_OPTION_DESCRIPTION and VERSION_OPTION_DESCRIPTION.
2001-12-01(usage): Use new macros, EMIT_HELP_DESCRIPTION and EMIT_VERSION_DESCRIPTIONJim Meyering
instead of hard-coding --help and --version descriptions.
2001-11-23Factor out some common strings to make translation easier.Jim Meyering
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.
2001-11-11(usage): Split --help output into smaller pieces.Jim Meyering
Use fputs, not printf.
2001-08-13(AUTHORS): Mark string for translation, since it contains the English word ↵Jim Meyering
`and'.
2001-04-14(usage): Tweak --help output: s/line,/newline,/Jim Meyering
2001-02-19(wc): Rename innermost `buf' to avoid shadowing warning.Jim Meyering
(wc): Rename local `wc' to avoid shadowing function name.
2000-10-30Include "system.h" after wctype.h (not before) to avoidJim Meyering
a compilation error on Solaris 5.5.1 systems.
2000-08-11Add support for multi-byte locales.Jim Meyering
(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.
2000-05-20Arrange to call close_stdout upon exit. Don't close stdout explicitly.Jim Meyering
1999-07-20(posixly_correct): Declare global.Jim Meyering
(write_counts): Use it to select printf formats. (main): Set posixly_correct from the POSIXLY_CORRECT envvar. From Peter Moulder.
1999-04-04Standardize --help and --version processing.Jim Meyering
1999-04-03Use AUTHORS in place of string in parse_long_options call.Jim Meyering
1999-04-03Insert AUTHORS definition.Jim Meyering
1999-04-03Use PROGRAM_NAME in place of string in parse_long_options call.Jim Meyering
1999-04-03define PROGRAM_NAMEJim Meyering
1999-03-04Include long-options.hJim Meyering
[long_options]: Remove the "help" and "version" entries. Remove declarations of show_help and show_version. (main): Use parse_long_options, including author name(s). Remove the show_version and show_help blocks.
1999-02-16update copyright datesJim Meyering
1999-01-14Don't prototype usage as static.Jim Meyering
1999-01-01(wc): Use binary mode for input.Jim Meyering
1998-09-19update bug-reporting addressJim Meyering
1998-06-29Update call to human_readable -- now there's one fewer arg.Jim Meyering
1998-06-29Change all uses of unlocked-wrapped functions to their upper case wrapper names.Jim Meyering
1998-04-12Use STREQ rather than strcmpJim Meyering
1998-04-12(wc): Declare per-file counters and `linepos' to be of type uintmax_t.Jim Meyering
Declare bytes_read to be ssize_t.
1998-04-11Include safe-read.h instead of merely declaring safe_read.Jim Meyering
1998-04-11[HAVE_INTTYPES_H]: Include inttypes.h.Jim Meyering
Declare counters to be of type uintmax_t. (write_counts): Use human_readable to format potentially-long-long numbers. Suggestion from Rogier Wolff.
1998-04-11*** empty log message ***Jim Meyering
1997-11-03(main): New option, --max-line-length (-L).Jim Meyering
(wc, write_counts): Implement it. From Bruno Haible.
1997-10-07update bug-reporting addressJim Meyering
1997-02-09update copyrights for 1997Jim Meyering
1997-02-01bracket bug address with <> and append a periodJim Meyering
1997-02-01Compare getopt_long return value against -1, not EOF. Use NULL, not '(int ↵Jim Meyering
*) 0' as last parameter in getopt_long call.
1996-11-23(usage): Alphabetize options like sort -f would.Jim Meyering
1996-11-03change bug-reporting addressJim Meyering
1996-11-02change bug-reporting addressJim Meyering