]> git.ipfire.org Git - thirdparty/coreutils.git/commitdiff
(main): Call dest_info_init if necessary.
authorJim Meyering <jim@meyering.net>
Fri, 28 Sep 2001 19:53:21 +0000 (19:53 +0000)
committerJim Meyering <jim@meyering.net>
Fri, 28 Sep 2001 19:53:21 +0000 (19:53 +0000)
src/mv.c

index 946ae75edf49aff346a4ab82e97fbf4ac54c91ea..c889a43560e8c7ccbdfb9b444084d7b77085ad0d 100644 (file)
--- a/src/mv.c
+++ b/src/mv.c
@@ -502,6 +502,13 @@ main (int argc, char **argv)
                                  ? n_files - 1
                                  : n_files - 2);
     unsigned int i;
+
+    /* Initialize the hash table only if we'll need it.
+       The problem it is used to detect can arise only if there are
+       two or more files to move.  */
+    if (last_file_idx)
+      dest_info_init ();
+
     for (i = 0; i <= last_file_idx; ++i)
       errors |= movefile (file[i], target_directory, dest_is_dir, &x);
   }