Jim Meyering [Wed, 23 Jun 2004 15:07:00 +0000 (15:07 +0000)]
Replace all occurrences of `(exit N); exit' with
`(exit N); exit N'. Otherwise, those many tests could exit with
improper exit status when exiting via e.g., a trapped interrupt.
Thanks to a report from Bob Proulx.
Jim Meyering [Wed, 23 Jun 2004 14:48:28 +0000 (14:48 +0000)]
*** empty log message ***
Jim Meyering [Wed, 23 Jun 2004 14:48:16 +0000 (14:48 +0000)]
(idle_string, print_user): New arg boottime,
specifying the most recent boot time. All uses changed.
(idle_string) Consider a line to be "old" if it hasn't been used
since the last boot time. Watch out for overflow when computing
times, and for times in the future.
(idle_string): Record latest boot time.
Jim Meyering [Tue, 22 Jun 2004 15:04:52 +0000 (15:04 +0000)]
*** empty log message ***
Jim Meyering [Tue, 22 Jun 2004 15:02:59 +0000 (15:02 +0000)]
.
Jim Meyering [Tue, 22 Jun 2004 15:00:53 +0000 (15:00 +0000)]
The 2004-06-19 fix for who and pinky was incomplete, as ctime
has undefined behavior if the year precedes -999 or follows 9999.
Since we have to stop using ctime anyway, we might as well use
strftime and fix the FIXME, and support internationalized dates.
* src/who.c: Include "hard-locale.h".
(time_format, time_format_width): New vars.
(time_string, print_line): Use them.
(main): Set them.
(time_string): Use localtime + strftime instead of
ctime, to avoid problems with years before -999 or after 9999.
* src/pinky.c: Likewise.
Jim Meyering [Tue, 22 Jun 2004 14:56:46 +0000 (14:56 +0000)]
The 2004-06-19 fix for who and pinky was incomplete, as ctime
has undefined behavior if the year precedes -999 or follows 9999.
Since we have to stop using ctime anyway, we might as well use
strftime and fix the FIXME, and support internationalized dates.
Include "hard-locale.h".
(time_format, time_format_width): New vars.
(time_string, print_line): Use them.
(main): Set them.
(time_string): Use localtime + strftime instead of
ctime, to avoid problems with years before -999 or after 9999.
Jim Meyering [Tue, 22 Jun 2004 14:55:34 +0000 (14:55 +0000)]
*** empty log message ***
Jim Meyering [Tue, 22 Jun 2004 14:55:30 +0000 (14:55 +0000)]
(usage): Correct description of `-t FD'. The file
descriptor, FD, is no longer optional. Reported by Ton Nijkes.
Jim Meyering [Tue, 22 Jun 2004 14:55:09 +0000 (14:55 +0000)]
*** empty log message ***
Jim Meyering [Tue, 22 Jun 2004 12:50:06 +0000 (12:50 +0000)]
*** empty log message ***
Jim Meyering [Tue, 22 Jun 2004 12:50:01 +0000 (12:50 +0000)]
Fix bug: GNU 'ls' didn't count columns correctly if user or group
names contained multibyte characters where the column count
differed from the byte count. This patch also corrects
some comments.
(format_user_or_group): New function, which counts columns correctly.
(format_user, format_group): Use it.
(format_user_or_group_width): New function, which counts columns correctly.
(format_user_width, format_group_width): Use it.
Jim Meyering [Tue, 22 Jun 2004 06:16:11 +0000 (06:16 +0000)]
*** empty log message ***
Jim Meyering [Mon, 21 Jun 2004 20:41:02 +0000 (20:41 +0000)]
*** empty log message ***
Jim Meyering [Mon, 21 Jun 2004 20:40:58 +0000 (20:40 +0000)]
Quote "$PATH" in PATH=$PATH.
Jim Meyering [Mon, 21 Jun 2004 17:10:05 +0000 (17:10 +0000)]
*** empty log message ***
Jim Meyering [Mon, 21 Jun 2004 17:06:58 +0000 (17:06 +0000)]
When running as root, be sure to propagate
PATH through to the process we exec as non-root.
Jim Meyering [Mon, 21 Jun 2004 17:06:11 +0000 (17:06 +0000)]
*** empty log message ***
Jim Meyering [Mon, 21 Jun 2004 15:36:56 +0000 (15:36 +0000)]
.
Jim Meyering [Mon, 21 Jun 2004 15:35:16 +0000 (15:35 +0000)]
*** empty log message ***
Jim Meyering [Mon, 21 Jun 2004 15:35:12 +0000 (15:35 +0000)]
(main): Don't segfault when calculating the
expected number of operands for `mknod NAME'.
Jim Meyering [Mon, 21 Jun 2004 15:04:54 +0000 (15:04 +0000)]
Adjust to new diagnostics.
Jim Meyering [Mon, 21 Jun 2004 15:03:45 +0000 (15:03 +0000)]
.
Jim Meyering [Mon, 21 Jun 2004 15:03:35 +0000 (15:03 +0000)]
(main): Standardize on the diagnostics given when someone gives
too few operands ("missing operand after `xxx'") or
too many operands ("extra operand `xxx'").
Include "quote.h" and/or "error.h" if it wasn't already being included.
Jim Meyering [Mon, 21 Jun 2004 15:02:28 +0000 (15:02 +0000)]
Standardize on the diagnostics given when someone gives
too few operands ("missing operand after `xxx'") or
too many operands ("extra operand `xxx'").
Include "quote.h" and/or "error.h" if it wasn't already being included.
(do_copy): Likewise.
Jim Meyering [Mon, 21 Jun 2004 15:02:14 +0000 (15:02 +0000)]
Standardize on the diagnostics given when someone gives
too few operands ("missing operand after `xxx'") or
too many operands ("extra operand `xxx'").
Include "quote.h" and/or "error.h" if it wasn't already being included.
(add_file_name, main): Likewise.
Jim Meyering [Mon, 21 Jun 2004 15:01:54 +0000 (15:01 +0000)]
Standardize on the diagnostics given when someone gives
too few operands ("missing operand after `xxx'") or
too many operands ("extra operand `xxx'").
Include "quote.h" and/or "error.h" if it wasn't already being included.
(beyond, main): Likewise.
Jim Meyering [Sun, 20 Jun 2004 14:24:12 +0000 (14:24 +0000)]
(input_seek_errno): Declare file-scoped variable as static.
Jim Meyering [Sun, 20 Jun 2004 14:02:47 +0000 (14:02 +0000)]
.
Jim Meyering [Sun, 20 Jun 2004 14:01:44 +0000 (14:01 +0000)]
*** empty log message ***
Jim Meyering [Sun, 20 Jun 2004 13:47:24 +0000 (13:47 +0000)]
Remove declaration of yesno.
Instead, include yesno.h.
Jim Meyering [Sun, 20 Jun 2004 13:44:53 +0000 (13:44 +0000)]
(obstack_base): Cast to (void *), per documentation.
Jim Meyering [Sun, 20 Jun 2004 13:44:12 +0000 (13:44 +0000)]
Include yesno.h.
(top_dir): Remove now-unnecessary cast of obstack_base.
(pop_dir): Likewise.
(full_filename_): Likewise.
Jim Meyering [Sun, 20 Jun 2004 13:42:43 +0000 (13:42 +0000)]
*** empty log message ***
Jim Meyering [Sun, 20 Jun 2004 13:42:32 +0000 (13:42 +0000)]
*** empty log message ***
Jim Meyering [Sun, 20 Jun 2004 13:42:30 +0000 (13:42 +0000)]
(libfetish_a_SOURCES): Add yesno.h.
Jim Meyering [Sun, 20 Jun 2004 13:42:14 +0000 (13:42 +0000)]
*** empty log message ***
Jim Meyering [Sun, 20 Jun 2004 13:42:11 +0000 (13:42 +0000)]
Include "yesno.h".
Jim Meyering [Sun, 20 Jun 2004 13:41:24 +0000 (13:41 +0000)]
*** empty log message ***
Jim Meyering [Sun, 20 Jun 2004 06:57:02 +0000 (06:57 +0000)]
*** empty log message ***
Jim Meyering [Sun, 20 Jun 2004 06:56:52 +0000 (06:56 +0000)]
Don't dump core if ctime returns NULL; this is possible on
hosts with 64-bit time_t and 32-bit int.
Include "inttostr.h".
(time_string): New function, copied from who.c.
(print_entry): Use it.
Jim Meyering [Sun, 20 Jun 2004 06:53:05 +0000 (06:53 +0000)]
Don't dump core if ctime returns NULL; this is possible on
hosts with 64-bit time_t and 32-bit int.
Include "inttostr.h".
(time_string): If ctime fails, print the raw time as an integer
instead of dumping core.
Jim Meyering [Sun, 20 Jun 2004 06:51:19 +0000 (06:51 +0000)]
*** empty log message ***
Jim Meyering [Sun, 20 Jun 2004 06:49:42 +0000 (06:49 +0000)]
(print_line): Don't truncate user names at 8 bytes.
Problem reported by Guido Leenders in:
http://lists.gnu.org/archive/html/bug-coreutils/2004-06/msg00056.html
Jim Meyering [Sat, 19 Jun 2004 12:28:16 +0000 (12:28 +0000)]
*** empty log message ***
Jim Meyering [Sat, 19 Jun 2004 12:28:02 +0000 (12:28 +0000)]
Remove all S_IS* and S_IF* definitions.
Instead, just include "stat-macros.h".
Jim Meyering [Sat, 19 Jun 2004 12:26:53 +0000 (12:26 +0000)]
Remove all S_IS* and S_IF* definitions.
Instead, just include "stat-macros.h".
Jim Meyering [Sat, 19 Jun 2004 12:25:31 +0000 (12:25 +0000)]
Remove all S_IS* and S_IF* definitions.
Instead, just include "stat-macros.h".
Jim Meyering [Sat, 19 Jun 2004 12:25:04 +0000 (12:25 +0000)]
Remove all S_IS* and S_IF* definitions.
Instead, just include "stat-macros.h".
Jim Meyering [Sat, 19 Jun 2004 12:24:36 +0000 (12:24 +0000)]
Remove all S_IS* and S_IF* definitions.
Instead, just include "stat-macros.h".
Jim Meyering [Sat, 19 Jun 2004 12:23:43 +0000 (12:23 +0000)]
*** empty log message ***
Jim Meyering [Sat, 19 Jun 2004 12:23:38 +0000 (12:23 +0000)]
Add S_IS* definitions from filemode.c.
(S_ISCTG): Define to zero if not already defined.
(S_ISOFD): Likewise.
(S_ISOFL): Likewise.
Jim Meyering [Sat, 19 Jun 2004 09:24:12 +0000 (09:24 +0000)]
*** empty log message ***
Jim Meyering [Sat, 19 Jun 2004 09:23:52 +0000 (09:23 +0000)]
(case_GETOPT_VERSION_CHAR): Switch back to using GNU_PACKAGE (from
PACKAGE) once again. This restores `GNU' to the parenthesized package
name in --version output. Before, the first argument from AC_INIT,
`GNU coreutils', would be propagated to the PACKAGE variable. Now,
`GNU ' is trimmed. Reported by Richard Stallman.
Jim Meyering [Thu, 17 Jun 2004 21:32:49 +0000 (21:32 +0000)]
*** empty log message ***
Jim Meyering [Thu, 17 Jun 2004 21:32:45 +0000 (21:32 +0000)]
(to_uchar): Rename function from `uchar'. The latter
would clash with a typedef in Tru64's <sys/types.h>. From Albert Chin.
Jim Meyering [Thu, 17 Jun 2004 14:48:08 +0000 (14:48 +0000)]
.
Jim Meyering [Thu, 17 Jun 2004 14:42:05 +0000 (14:42 +0000)]
.
Jim Meyering [Thu, 17 Jun 2004 14:41:34 +0000 (14:41 +0000)]
*** empty log message ***
Jim Meyering [Thu, 17 Jun 2004 14:40:51 +0000 (14:40 +0000)]
*** empty log message ***
Jim Meyering [Thu, 17 Jun 2004 14:38:52 +0000 (14:38 +0000)]
(yes invocation): "--" is now supported.
(false invocation, true invocation): --help and --version now
work unconditionally.
Jim Meyering [Thu, 17 Jun 2004 14:34:07 +0000 (14:34 +0000)]
(main): Recognize --help and --version even if POSIXLY_CORRECT is set.
Jim Meyering [Thu, 17 Jun 2004 13:09:21 +0000 (13:09 +0000)]
(main): Handle "--".
Jim Meyering [Thu, 17 Jun 2004 06:46:39 +0000 (06:46 +0000)]
*** empty log message ***
Jim Meyering [Thu, 17 Jun 2004 06:46:33 +0000 (06:46 +0000)]
(GL_FUNC_GETCWD_PATH_MAX): Fix typo: getcwd
was being replaced when it shouldn't have been, and vice versa.
Jim Meyering [Tue, 15 Jun 2004 21:56:15 +0000 (21:56 +0000)]
Remove special cases for POSIXLY_CORRECT when POSIX allows the GNU behavior.
(pr invocation, unlink invocation): Document this.
Jim Meyering [Tue, 15 Jun 2004 21:55:28 +0000 (21:55 +0000)]
*** empty log message ***
Jim Meyering [Tue, 15 Jun 2004 18:04:54 +0000 (18:04 +0000)]
*** empty log message ***
Jim Meyering [Tue, 15 Jun 2004 18:04:47 +0000 (18:04 +0000)]
Adjust to the new semantics for \x if POSIXLY_CORRECT.
Jim Meyering [Tue, 15 Jun 2004 18:04:13 +0000 (18:04 +0000)]
(main): Recognize --help, --version even if
POSIXLY_CORRECT. POSIX does not specify any options, but it
does not prohibit options either, so "unlink" is like "expr" here.
Jim Meyering [Tue, 15 Jun 2004 18:00:58 +0000 (18:00 +0000)]
(parse_obsolescent_option): Support multiple file operands
even if POSIXLY_CORRECT, since POSIX does not require a diagnostic.
Jim Meyering [Tue, 15 Jun 2004 18:00:35 +0000 (18:00 +0000)]
(print_esc): Support \x, \u, \U even if POSIXLY_CORRECT,
since POSIX says the behavior is unspecified here.
(main): Recognize --help, --version even if
POSIXLY_CORRECT. POSIX does not specify any options, but it
does not prohibit options either, so "printf" is like "expr" here.
Jim Meyering [Tue, 15 Jun 2004 18:00:20 +0000 (18:00 +0000)]
Include "hard-locale.h".
(main): When in a non-POSIX locale, ignore POSIXLY_CORRECT, since
POSIX specifies the behavior only in the POSIX locale.
Jim Meyering [Tue, 15 Jun 2004 18:00:03 +0000 (18:00 +0000)]
(decode_switches): Pay attention to TABSIZE even if POSIXLY_CORRECT
is set. POSIX reserves upper-case environment variables to the
implementation, so it's OK for ls to depend on TABSIZE.
Jim Meyering [Mon, 14 Jun 2004 18:12:44 +0000 (18:12 +0000)]
*** empty log message ***
Jim Meyering [Mon, 14 Jun 2004 17:21:55 +0000 (17:21 +0000)]
.
Jim Meyering [Mon, 14 Jun 2004 17:20:29 +0000 (17:20 +0000)]
*** empty log message ***
Jim Meyering [Mon, 14 Jun 2004 17:20:19 +0000 (17:20 +0000)]
(TESTS): Add pwd.
(BUILD_SRC_DIR): Define BUILD_SRC_DIR.
Jim Meyering [Mon, 14 Jun 2004 17:19:52 +0000 (17:19 +0000)]
*** empty log message ***
Jim Meyering [Mon, 14 Jun 2004 17:19:46 +0000 (17:19 +0000)]
New test, for fix of 2004-04-19.
Jim Meyering [Mon, 14 Jun 2004 14:40:21 +0000 (14:40 +0000)]
*** empty log message ***
Jim Meyering [Mon, 14 Jun 2004 14:40:12 +0000 (14:40 +0000)]
Remove declaration of euidaccess.
Instead, include "euidaccess.h".
Jim Meyering [Sun, 13 Jun 2004 22:03:11 +0000 (22:03 +0000)]
*** empty log message ***
Jim Meyering [Sun, 13 Jun 2004 22:03:07 +0000 (22:03 +0000)]
(PIDSTR_DECL_AND_INIT): Don't assume pid_t fits in int.
(UT_ID) [!HAVE_STRUCT_XTMP_UT_ID]: Remove bogus comment,
as (sizeof "??") reliably returns 3.
(print_line): Guard against idle and pid being too long
(which is possible when printing headers).
(print_user): Allocate enough bytes for idlestr. Use IDLESTR_LEN.
Avoid unnecessary cast of sizeof to int.
(make_id_equals_comment): Do not assume that UT_ID returns
a string; it might return a non-null-terminated array.
Use strncat instead. It's not very often where strncat is
exactly what you want, but this is one of those rare cases.
Jim Meyering [Sat, 12 Jun 2004 08:07:41 +0000 (08:07 +0000)]
*** empty log message ***
Jim Meyering [Sat, 12 Jun 2004 08:07:30 +0000 (08:07 +0000)]
(extract_trimmed_name): Don't apply strchr to a
non-string; this leads to undefined behavior.
Jim Meyering [Sat, 12 Jun 2004 08:06:12 +0000 (08:06 +0000)]
*** empty log message ***
Jim Meyering [Sat, 12 Jun 2004 08:05:59 +0000 (08:05 +0000)]
(list_entries_who): Don't output a trailing space.
Jim Meyering [Wed, 9 Jun 2004 15:13:33 +0000 (15:13 +0000)]
*** empty log message ***
Jim Meyering [Wed, 9 Jun 2004 15:13:27 +0000 (15:13 +0000)]
(AC_FUNC_CALLOC): Remove use of AN_FUNCTION.
Jim Meyering [Wed, 9 Jun 2004 14:47:36 +0000 (14:47 +0000)]
*** empty log message ***
Jim Meyering [Wed, 9 Jun 2004 14:47:29 +0000 (14:47 +0000)]
(usage): Improve wording in description of the --time=WORD option.
Jim Meyering [Wed, 9 Jun 2004 14:45:38 +0000 (14:45 +0000)]
Adjust to accommodate Paul Eggert's changes of 2004-06-08.
Jim Meyering [Wed, 9 Jun 2004 13:54:21 +0000 (13:54 +0000)]
*** empty log message ***
Jim Meyering [Wed, 9 Jun 2004 13:54:11 +0000 (13:54 +0000)]
(change_file_owner): Change names of parameters
old_uid and old_gid to required_uid and required_gid respectively.
Jim Meyering [Wed, 9 Jun 2004 13:37:58 +0000 (13:37 +0000)]
*** empty log message ***
Jim Meyering [Wed, 9 Jun 2004 13:37:52 +0000 (13:37 +0000)]
Adjust chmod and chown to be similar if -c or -v are given. In
particular, a no-op chown is no longer reported as a change; this
reverts to previous behavior. Also, fix both commands so that -v
report failures even if the failure is not due to the chmod or
chown syscalls.
* src/chown-core.c (change_file_owner): Return -1 on error, not
1 sometimes and -1 on others. Our caller ORs together our results,
and (-1 | 1) == 0 on ones-complement hosts.
With -v report all errors verbosely, not just some.
Fix bug when chopt->root_dev_ino && !chopt->affect_symlink_referent:
file_stats wasn't set properly in that case.
Jim Meyering [Wed, 9 Jun 2004 09:06:34 +0000 (09:06 +0000)]
(mode_changed): Return false, not 0, now that the function returns `bool'.
Jim Meyering [Wed, 9 Jun 2004 09:05:02 +0000 (09:05 +0000)]
Adjust chmod and chown to be similar if -c or -v are given. In
particular, a no-op chown is no longer reported as a change; this
reverts to previous behavior. Also, fix both commands so that -v
report failures even if the failure is not due to the chmod or
chown syscalls.
* src/chmod.c (CH_NOT_APPLIED): New constant.
(describe_change): Handle it.
(process_file): Use it, if a symlink wasn't changed.
(mode_changed): Return bool, not int. Accept new argument
NEW_MODE; all callers changed. This lets us avoid statting the
file unless the new mode has unusual bits.
(process_file): Return -1 on error. With -v, report all errors
verbosely, not just some.
Jim Meyering [Tue, 8 Jun 2004 17:07:19 +0000 (17:07 +0000)]
.