summaryrefslogtreecommitdiff
path: root/src/copy.c
diff options
context:
space:
mode:
authorJim Meyering <jim@meyering.net>1999-01-31 15:12:43 +0000
committerJim Meyering <jim@meyering.net>1999-01-31 15:12:43 +0000
commiteaec7699ac4ac6cd824496dbc526afcab9635bd7 (patch)
tree53b2bb323cdebada65e217c0ed818846788a3d59 /src/copy.c
parente960794409ff585980ce72f18dfe312ff9f5ff45 (diff)
downloadcoreutils-eaec7699ac4ac6cd824496dbc526afcab9635bd7.tar.xz
(copy_internal): Describe any backup-related renaming
operations when in verbose mode. (copy_internal): Likewise. Based on changes from Marty Leisner.
Diffstat (limited to 'src/copy.c')
-rw-r--r--src/copy.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/copy.c b/src/copy.c
index fd1bee4f3..6c40abffb 100644
--- a/src/copy.c
+++ b/src/copy.c
@@ -543,6 +543,12 @@ copy_internal (const char *src_path, const char *dst_path,
else
dst_backup = NULL;
}
+ else
+ {
+ /* rename succeeded */
+ if (x->verbose)
+ printf (_("%s -> %s (backup)\n"), dst_path, dst_backup);
+ }
new_dst = 1;
}
else if (x->force)
@@ -913,6 +919,11 @@ un_backup:
{
if (rename (dst_backup, dst_path))
error (0, errno, _("cannot un-backup `%s'"), dst_path);
+ else
+ {
+ if (x->verbose)
+ printf (_("%s -> %s (unbackup)\n"), dst_backup, dst_path);
+ }
}
return 1;
}