Jim Meyering [Fri, 12 Mar 2004 11:53:18 +0000 (11:53 +0000)]
Sometimes, when source and destination partition are different,
mv mistakenly fails to preserve a hard link. Reported by IIDA Yosiaki.
When moving a set of N hard-linked files between
partitions, via two or more command line arguments where the
command line argument containing the Nth link contains no other
link to that same file, mv would mistakenly copy the file, rather
than hard-linking it to the other(s). That happens because when the
final link is processed, its link count has been reduced to 1 since
the other links have been `copied' to the destination partition
and the source links have been removed.
(copy_internal): When in move mode, use the source dev/inode
pair to look up destination name even when st_nlink == 1.
Jim Meyering [Thu, 4 Mar 2004 08:42:20 +0000 (08:42 +0000)]
Include "cloexec.h" first, and <unistd.h> before <fcntl.h>.
(set_cloexec_flag): Use bool for booleans. All uses changed.
If F_GETFD returns a negative number (not just -1), report a
failure. Don't use F_SETFD if the flags are already right.
Don't report a failure with F_SETFD unless it returns -1.
Jim Meyering [Wed, 3 Mar 2004 07:57:33 +0000 (07:57 +0000)]
Don't include "posixver.h".
(parse_user_spec): Fall back on USER.GROUP parsing regardless
of POSIX version, as POSIX 1003.1-2001 allows that behavior as a
compatible extension. Simplify code by removing a boolean int
that was always nonzero if a string was nonnull.
Jim Meyering [Wed, 3 Mar 2004 07:52:36 +0000 (07:52 +0000)]
(chown invocation): Document that chown now falls
back on USER.GROUP parsing regardless of POSIX version, as POSIX
1003.1-2001 allows that behavior as a compatible extension.
Jim Meyering [Tue, 2 Mar 2004 22:49:44 +0000 (22:49 +0000)]
Include <signal.h> when checking for strsignal,
sys_siglist, and friends. Problem reported by Toney Leneis in
<http://mail.gnu.org/archive/html/bug-coreutils/2004-02/msg00136.html>.
Jim Meyering [Sun, 22 Feb 2004 14:56:58 +0000 (14:56 +0000)]
(eval, eval7, eval6, eval5, eval4, eval3, eval2, eval1):
Accept a bool argument specifying whether to evaluate the
expression. This is to allow short-circuit evaluation. All
callers changed.
(null): Report that a string is zero even if it has
a form like "-0" or "00".
(eval1, eval): Use short-circuit evaluation for | and &.
(eval): Return 0 if both arguments are null or zero, instead
of returning the first argument.
Jim Meyering [Sat, 21 Feb 2004 09:31:11 +0000 (09:31 +0000)]
(expr invocation):
Document what forms integers may take, and say "integer"
consistently instead of "number". Warn about operands
that "expr" can misinterpret, and how to work around the problem.
Jim Meyering [Sat, 21 Feb 2004 09:21:15 +0000 (09:21 +0000)]
(usage): Tell what comm does when there are no options.
Reword in terms of FILE1 and FILE2 rather than `left file' and
`right file'. Suggestion from Dan Jacobson.
Jim Meyering [Tue, 17 Feb 2004 10:52:49 +0000 (10:52 +0000)]
(usage) [-u]: Add punctuation so that the description in
the help2man-generated (line-joined) man page is more readable.
Reported by Tim Waugh.
[-T]: Add a semicolon, for the same reason.