svn commit: r284916 - head/bin/mv
Jilles Tjoelker
jilles at FreeBSD.org
Sun Jun 28 21:36:01 UTC 2015
Author: jilles
Date: Sun Jun 28 21:36:00 2015
New Revision: 284916
URL: https://svnweb.freebsd.org/changeset/base/284916
Log:
mv: Improve message when moving two or more files to non-directory.
The message text is from cp, which has had a nicer message for this since
2007 (PR bin/50656).
As with cp, the exit status changes from 64 to 1.
PR: 201083
MFC after: 1 week
Modified:
head/bin/mv/mv.c
Modified: head/bin/mv/mv.c
==============================================================================
--- head/bin/mv/mv.c Sun Jun 28 21:06:45 2015 (r284915)
+++ head/bin/mv/mv.c Sun Jun 28 21:36:00 2015 (r284916)
@@ -122,7 +122,7 @@ main(int argc, char *argv[])
*/
if (stat(argv[argc - 1], &sb) || !S_ISDIR(sb.st_mode)) {
if (argc > 2)
- usage();
+ errx(1, "%s is not a directory", argv[argc - 1]);
exit(do_move(argv[0], argv[1]));
}
More information about the svn-src-head
mailing list