1
0
mirror of git://git.sv.gnu.org/coreutils.git synced 2026-07-25 10:16:53 +02:00
Commit Graph

16123 Commits

Author SHA1 Message Date
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
Jim Meyering 1f3c90c6a5 (expected_failure_status_expr): Record that
expr exits with status of 3 for e.g., a write error.
2003-07-19 11:39:22 +00:00
Jim Meyering ae481a2cb7 *** empty log message *** 2003-07-19 11:19:16 +00:00
Jim Meyering 1d510c3f9b Use `id -u' to see if we're running as root,
rather than trying go write to an write-protected file.
When running as root, ensure $NON_ROOT_USERNAME is valid.
When running as root with `require-non-root', ensure that `.'
is writable by $NON_ROOT_USERNAME, then reinvoke $0 set-user-ID
to $NON_ROOT_USERNAME.  If `.' is not writable, then skip the test.
2003-07-19 11:19:12 +00:00
Jim Meyering c321e53e88 *** empty log message *** 2003-07-19 08:17:16 +00:00
Jim Meyering db34cf4ee6 Include "exitfail.h".
(main): Set exit_failure rather than calling close_stdout_set_status.
2003-07-19 08:17:06 +00:00
Jim Meyering fe52d65af0 Include "exitfail.h".
(main): Set exit_failure rather than calling close_stdout_set_status.
2003-07-19 08:16:38 +00:00
Jim Meyering 3fd76bf433 *** empty log message *** 2003-07-19 08:09:01 +00:00
Jim Meyering 9802c059ff Likewise. Include "closeout.h" right after config.h,
to test that it can stand by itself.  Include "exitfail.h".
Clients should set exit_failure instead.
(EXIT_FAILURE): Remove; no longer needed.  Do not include <stdlib.h>.
2003-07-19 08:08:56 +00:00
Jim Meyering 2925e558cb (close_stdout_set_status, close_stdout_status): Remove. 2003-07-19 08:05:44 +00:00
Jim Meyering 8ed1e0ab9a *** empty log message *** 2003-07-18 18:08:08 +00:00
Jim Meyering eea7d0c8da (memcoll) [!HAVE_STRCOLL]: Clear errno. 2003-07-18 18:07:48 +00:00
Jim Meyering d2cc1e9856 *** empty log message *** 2003-07-18 09:58:59 +00:00
Jim Meyering 05b4128b5d Update to use newer framework. 2003-07-18 09:48:16 +00:00
Jim Meyering c42d31bc78 Use $srcdir/../priv-check, create a temporary
directory, and remove Perl-coded `you may not run as root' test.
2003-07-18 09:12:23 +00:00
Jim Meyering 10c48512f0 Use $srcdir/../priv-check, rather than
hard-coding something not quite equivalent.  Reported by Paul Jarc.
2003-07-18 09:05:49 +00:00
Jim Meyering 8dd15f024c *** empty log message *** 2003-07-18 08:53:32 +00:00
Jim Meyering 1d7432c0ef (main): Use close_stdout via atexit.
Now `sort --version' and `sort --help' fail, as they should
when their output is redirected to /dev/full.
2003-07-18 08:53:05 +00:00
Jim Meyering ec5c04d7d8 (usage): Don't call close_stdout here.
(main): Use close_stdout via atexit.
Now `su --version > /dev/full' fails, as it should.
Somehow, the change of 2000-05-07 that purports to fix this
was not checked in.
2003-07-18 08:38:43 +00:00
Jim Meyering c03aeeae23 *** empty log message *** 2003-07-18 08:38:29 +00:00
Jim Meyering 429c70029c *** empty log message *** 2003-07-18 08:12:00 +00:00
Jim Meyering daced4a5fb (--help/--version vs. /dev/full): Special-case
`[' to protect it from expected_failure_status-`eval'.
2003-07-18 08:11:55 +00:00
Jim Meyering 0f16eafda9 *** empty log message *** 2003-07-18 08:01:36 +00:00
Jim Meyering 4efc97aa9f (101, 102): Update tests of -c accordingly. 2003-07-18 08:01:26 +00:00