]> git.ipfire.org Git - thirdparty/coreutils.git/commitdiff
cp: tweak internal name
authorPaul Eggert <eggert@cs.ucla.edu>
Wed, 12 Jan 2022 21:52:23 +0000 (13:52 -0800)
committerPaul Eggert <eggert@cs.ucla.edu>
Thu, 13 Jan 2022 19:36:51 +0000 (11:36 -0800)
* src/cp.c (do_copy): Omit confusingly-named local new_dest, since
there’s another var new_dst that means something quite different.

src/cp.c

index a3f2e59305407691149f08625fc136689813b1e0..658851b43fb9fbf3c11e9705c20f0160b2606734 100644 (file)
--- a/src/cp.c
+++ b/src/cp.c
@@ -738,7 +738,6 @@ do_copy (int n_files, char **file, char const *target_directory,
     }
   else /* !target_directory */
     {
-      char const *new_dest;
       char const *source = file[0];
       char const *dest = file[1];
       bool unused;
@@ -763,7 +762,7 @@ do_copy (int n_files, char **file, char const *target_directory,
         {
           static struct cp_options x_tmp;
 
-          new_dest = find_backup_file_name (AT_FDCWD, dest, x->backup_type);
+          dest = find_backup_file_name (AT_FDCWD, dest, x->backup_type);
           /* Set x->backup_type to 'no_backups' so that the normal backup
              mechanism is not used when performing the actual copy.
              backup_type must be set to 'no_backups' only *after* the above
@@ -773,12 +772,8 @@ do_copy (int n_files, char **file, char const *target_directory,
           x_tmp.backup_type = no_backups;
           x = &x_tmp;
         }
-      else
-        {
-          new_dest = dest;
-        }
 
-      ok = copy (source, new_dest, 0, x, &unused, NULL);
+      ok = copy (source, dest, false, x, &unused, NULL);
     }
 
   return ok;