Commit Graph

16146 Commits

Author SHA1 Message Date
Jim Meyering a68226bb5b *** empty log message *** 2003-07-23 05:38:41 +00:00
Jim Meyering 0ff72c1f5c (XCALLOC, XREALLOC, CCLONE): Fix under- and over-parenthesization in macros. 2003-07-23 05:38:36 +00:00
Jim Meyering a19486436f tweak comment 2003-07-22 21:56:23 +00:00
Jim Meyering d146304528 *** empty log message *** 2003-07-22 21:53:44 +00:00
Jim Meyering 9239223865 (set_fields): Use xcalloc in place of xmalloc+memset. 2003-07-22 21:53:39 +00:00
Jim Meyering 9903c3432c *** empty log message *** 2003-07-22 16:32:38 +00:00
Jim Meyering 1277d8b91c (.x.1): Substitute 's,$t/$*,$*,' on output of
help2man, to avoid having `rm.td/rm' appear in rm.1.  Reported by
Thomas Luzat.  See http://bugs.debian.org/202413 for details.
2003-07-22 16:32:33 +00:00
Jim Meyering f7259485a4 *** empty log message *** 2003-07-22 16:31:16 +00:00
Jim Meyering 4457508c7a don't include stdboo.h. it's already included via system.h 2003-07-22 14:18:58 +00:00
Jim Meyering 0bdc16c6f5 . 2003-07-22 14:16:50 +00:00
Jim Meyering 52393e15b7 *** empty log message *** 2003-07-22 14:15:40 +00:00
Jim Meyering 6dc75c643b (main) [lint]: Initialize spec_list_string to avoid warning. 2003-07-22 14:15:31 +00:00
Jim Meyering e21334b795 Don't include <unistd.h>. system.h already does that. 2003-07-22 14:13:37 +00:00
Jim Meyering 15890cb3df *** empty log message *** 2003-07-22 13:00:48 +00:00
Jim Meyering 3fe298f13f (set_fields): Mark all selected indices before trying to
determine range endpoints.
2003-07-22 13:00:45 +00:00
Jim Meyering c55974d115 New test for the above fix. 2003-07-22 12:44:22 +00:00
Jim Meyering 68371a1d4c *** empty log message *** 2003-07-22 11:56:37 +00:00
Jim Meyering bf2cf0b7ba Begin to address this comment: What if someone wants to
extract the 1,000,000-th field of some huge input file?
The first step is to rearrange things so that the values
in the printable_field array are all 0/1 rather than 0/1/2.

(RANGE_START_SENTINEL): Remove.
Store range-start indices in a hash table, rather than
overloading the `printable_field' array.
(range_start_ht): New global.
(hash_int, hash_compare_ints, is_range_start_index): New functions.
(print_kth): Use is_range_start_index; don't test printable_field.
(set_fields): Detect overflow.
(set_fields): Insert each range-start index into range_start_ht.
(main): Call set_fields only once, and only after
output_delimiter_specified and (if required) range_start_ht have
been defined.
2003-07-22 11:56:24 +00:00
Jim Meyering a5eacea399 *** empty log message *** 2003-07-20 21:13:08 +00:00
Jim Meyering 1eb0fd1dd1 (get_input_fstatus): Fix typo: `stat' was being
invoked with a null pointer when there were no file arguments.
2003-07-20 21:13:04 +00:00
Jim Meyering 1fb0960527 *** empty log message *** 2003-07-20 16:04:04 +00:00
Jim Meyering c279f529aa (sc_changelog): Add another nit-picky check. 2003-07-20 16:03:58 +00:00
Jim Meyering 72214f2990 . 2003-07-20 16:02:28 +00:00
Jim Meyering 1fdb5a48fa . 2003-07-20 15:57:27 +00:00
Jim Meyering 8b5fe89e35 *** empty log message *** 2003-07-20 15:51:06 +00:00
Jim Meyering 4840b689ee *** empty log message *** 2003-07-20 15:45:58 +00:00
Jim Meyering bec97d9ee9 *** empty log message *** 2003-07-20 15:45:32 +00:00
Jim Meyering 224d5c8170 (write_counts): Add a comment.
(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 15:45:29 +00:00
Jim Meyering 47c0b910f1 *** empty log message *** 2003-07-20 15:25:02 +00:00
Jim Meyering b17a0f8d39 Adjust to the new output widths. 2003-07-20 15:24:52 +00:00
Jim Meyering 6c32aa26a2 wc count field widths now are heuristically adjusted depending
on the input size, if known.  If only one count is printed, it
is guaranteed to be printed without leading spaces.

Previously, wc did not align the count fields if
POSIXLY_CORRECT was set, but POSIX did not actually require
this undesirable behavior, so it has been removed.

* doc/coreutils.texi (wc invocation): Likewise.
2003-07-20 15:24:21 +00:00
Jim Meyering 85c6c1592c *** empty log message *** 2003-07-20 15:22:42 +00:00
Jim Meyering 6e1923f4c1 (number_width): New var.
(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-07-20 15:22:25 +00:00
Jim Meyering 32d2cea9b8 convert each 8-space prefix to a TAB 2003-07-20 11:19:12 +00:00
Jim Meyering 107ee59889 convert each 8-space prefix to a TAB 2003-07-20 11:18:12 +00:00
Jim Meyering 018d21f27b convert each 8-space prefix to a TAB 2003-07-20 11:17:51 +00:00
Jim Meyering 34ecf6b086 convert each 8-space prefix to a TAB 2003-07-20 11:17:26 +00:00
Jim Meyering a9c557304a *** empty log message *** 2003-07-20 06:30:06 +00:00
Jim Meyering c67f098cb7 *** empty log message *** 2003-07-20 05:38:28 +00:00
Jim Meyering 4383217a7b *** empty log message *** 2003-07-20 05:36:10 +00:00
Jim Meyering 479038b02c from gnulib 2003-07-20 05:35:54 +00:00
Jim Meyering e13407adf9 (jm_MACROS): Invoke gl_MEMCOLL. 2003-07-20 05:35:38 +00:00
Jim Meyering 18695bd657 *** empty log message *** 2003-07-19 17:30:49 +00:00
Jim Meyering 51ff0dc7c0 Restore definition of $verbose. 2003-07-19 12:00:38 +00:00
Jim Meyering 30c42b2089 Don't create temporary directory -- we don't use it. 2003-07-19 11:59:12 +00:00
Jim Meyering 1ce4f09d1e *** empty log message *** 2003-07-19 11:59:02 +00:00
Jim Meyering afd207eda5 remove now-redundant VERSION check 2003-07-19 11:54:39 +00:00
Jim Meyering dc701b5cf2 *** empty log message *** 2003-07-19 11:47:22 +00:00
Jim Meyering d7a263ce2a Don't open-code test for UID != 0.
Use priv-check's require-non-root instead.
Update to use newer framework.
2003-07-19 11:47:17 +00:00
Jim Meyering 0aa4df1070 *** empty log message *** 2003-07-19 11:39:27 +00:00