diff options
author | Jim Meyering <jim@meyering.net> | 1996-09-08 17:55:24 +0000 |
---|---|---|
committer | Jim Meyering <jim@meyering.net> | 1996-09-08 17:55:24 +0000 |
commit | 4526777121ad2a7b442c9ad3881062efe9853f40 (patch) | |
tree | 568cd131bee7e64ac133187fd7862d2e44a83474 | |
parent | 97df7b0013388c31fb50155b9495354c41c2e4da (diff) | |
download | coreutils-4526777121ad2a7b442c9ad3881062efe9853f40.tar.xz |
(do_copy): Set backup_type to `none' only *after*
calling to find_backup_file_name. Reported by Eli Zaretskii.
-rw-r--r-- | src/cp.c | 7 |
1 files changed, 6 insertions, 1 deletions
@@ -507,8 +507,13 @@ do_copy (int argc, char **argv) && STREQ (source, dest) && !new_dst && S_ISREG (sb.st_mode)) { - backup_type = none; new_dest = find_backup_file_name (dest); + /* Set backup_type to `none' so that the normal backup + mechanism is not used when performing the actual copy. + backup_type must be set to `none' only *after* the above + call to find_backup_file_name -- that function uses + backup_type to determine the suffix it applies. */ + backup_type = none; if (new_dest == NULL) error (1, 0, _("virtual memory exhausted")); } |