Age | Commit message (Collapse) | Author |
|
last operands that are (or look like) directories.
* src/cp.c (target_directory_operand): New, nearly-common function,
It reports an error if the destination appears to be a directory
(e.g., because it has a trailing slash) but is not.
* src/cp.c (do_copy): Use it.
* src/cp.c (do_copy): Don't assume argc is positive.
Don't bother to lstat dest, since copy() will do that for us.
Use "const" to avoid the need for cast.
* src/cp.c (do_copy): Don't output a usage message because of file
problems (e.g., an operand is not a directory). Use it only for
syntax. Standardize on "target %s is not a directory" for the
diagnostic.
* src/cp.c (do_copy): Remove test for trailing slash, since
target_directory_operand now does this.
* src/cp.c (main): Reject multiple target directories.
Check whether a specified target is a directory when parsing the
options, using stat. This gives more-accurate diagnostics.
|
|
--target-directory: s/move/copy/. From Paul Jarc.
|
|
|
|
d/" incorrectly created a link d/x/x. It also saves some system
calls.
(main): Don't append basename to dest if this
results in an existing directory name.
|
|
|
|
"missing operand\nTry printf --help..." message -- to be consistent.
|
|
|
|
(main): Avoid subscript error when the destination is "".
|
|
|
|
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.
|
|
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.
|
|
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.
|
|
descriptor, FD, is no longer optional. Reported by Ton Nijkes.
|
|
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.
|
|
|
|
expected number of operands for `mknod NAME'.
|
|
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.
|
|
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.
|
|
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.
|
|
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.
|
|
|
|
Instead, include yesno.h.
|
|
(top_dir): Remove now-unnecessary cast of obstack_base.
(pop_dir): Likewise.
(full_filename_): Likewise.
|
|
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.
|
|
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.
|
|
Problem reported by Guido Leenders in:
http://lists.gnu.org/archive/html/bug-coreutils/2004-06/msg00056.html
|
|
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.
|
|
would clash with a typedef in Tru64's <sys/types.h>. From Albert Chin.
|
|
|
|
|
|
|
|
POSIXLY_CORRECT. POSIX does not specify any options, but it
does not prohibit options either, so "unlink" is like "expr" here.
|
|
even if POSIXLY_CORRECT, since POSIX does not require a diagnostic.
|
|
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.
|
|
(main): When in a non-POSIX locale, ignore POSIXLY_CORRECT, since
POSIX specifies the behavior only in the POSIX locale.
|
|
is set. POSIX reserves upper-case environment variables to the
implementation, so it's OK for ls to depend on TABSIZE.
|
|
Instead, include "euidaccess.h".
|
|
(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.
|
|
|
|
|
|
old_uid and old_gid to required_uid and required_gid respectively.
|
|
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.
|
|
|
|
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.
|
|
|
|
|
|
needed. Chown a directory only after chowning its children; this
avoids problems if the new directory ownership doesn't permit
access to the children. Dereference symlinks before doing
ROOT_DEV_INO_CHECK, not after, so that we catch symlinks to /.
Do not optimize away the chown() system call when the file's owner
and group already have the desired value. POSIX does not permit
this optimization. Rely on chown and lchown to do the right
thing with symlinks and/or -1 arguments, now that we have wrappers
to do this. Use ENOTSUPP not ENOSYS, and ignore all ENOTSUPP
errors, not just command-line errors.
(chown_files): Pass FTS_STAT to xfts_open if we don't need file status.
|
|
requires either -H or -L, and -R -h requires -P. If -H, specify
FTS_PHYSICAL as well as FTS_COMFOLLOW; this is faster. Make this
file as much like chown.c as possible.
|
|
requires either -H or -L, and -R -h requires -P. If -H, specify
FTS_PHYSICAL as well as FTS_COMFOLLOW; this is faster. Make this
file as much like chgrp.c as possible.
|
|
|