summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorPaul Eggert <eggert@cs.ucla.edu>2007-03-16 21:41:50 +0100
committerJim Meyering <jim@meyering.net>2007-03-16 21:41:50 +0100
commit369aaf7e5dcabf995683eea9a3a1e497ade9cd12 (patch)
tree0e0bd52515194d06487acb8b6e25331011a53c3f /src
parent39e85b7258340611a77a70e2ad46184f1081bbdf (diff)
downloadcoreutils-369aaf7e5dcabf995683eea9a3a1e497ade9cd12.tar.xz
* src/copy.c: Include filemode.h.
(overwrite_prompt): Say "try to overwrite", not "overwrite", to make it clearer that the attempt may fail. Problem reported by Dan Jacobson in: http://lists.gnu.org/archive/html/bug-coreutils/2007-03/msg00130.html Output symbolic mode as well as numeric. * tests/mv/i-2 (fail): Adjust to new prompt format.
Diffstat (limited to 'src')
-rw-r--r--src/copy.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/copy.c b/src/copy.c
index 49bbb8ce4..4bdb75cbb 100644
--- a/src/copy.c
+++ b/src/copy.c
@@ -38,6 +38,7 @@
#include "euidaccess.h"
#include "error.h"
#include "fcntl--.h"
+#include "filemode.h"
#include "filenamecat.h"
#include "full-write.h"
#include "getpagesize.h"
@@ -797,10 +798,14 @@ overwrite_prompt (char const *dst_name, struct stat const *dst_sb)
{
if (euidaccess (dst_name, W_OK) != 0)
{
+ char perms[12]; /* "-rwxrwxrwx " ls-style modes. */
+ strmode (dst_sb->st_mode, perms);
+ perms[10] = '\0';
fprintf (stderr,
- _("%s: overwrite %s, overriding mode %04lo? "),
+ _("%s: try to overwrite %s, overriding mode %04lo (%s)? "),
program_name, quote (dst_name),
- (unsigned long int) (dst_sb->st_mode & CHMOD_MODE_BITS));
+ (unsigned long int) (dst_sb->st_mode & CHMOD_MODE_BITS),
+ &perms[1]);
}
else
{