summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/copy.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/copy.c b/src/copy.c
index 5b69e8ad2..c8d09b4ee 100644
--- a/src/copy.c
+++ b/src/copy.c
@@ -1185,7 +1185,10 @@ copy_internal (char const *src_name, char const *dst_name,
}
}
- if (x->backup_type != no_backups)
+ if (x->backup_type != no_backups
+ /* Don't try to back up a destination if the last
+ component of src_name is "." or "..". */
+ && ! dot_or_dotdot (last_component (src_name)))
{
char *tmp_backup = find_backup_file_name (dst_name,
x->backup_type);