]> git.ipfire.org Git - thirdparty/coreutils.git/commitdiff
(main): Handle argc < optind.
authorJim Meyering <jim@meyering.net>
Sat, 10 May 2003 14:37:12 +0000 (14:37 +0000)
committerJim Meyering <jim@meyering.net>
Sat, 10 May 2003 14:37:12 +0000 (14:37 +0000)
src/mv.c

index 8c6f3b5ee23d13158415128a7ee24534be090ebd..b96c7cf36d9dcbd3e2065d3aa8e3a5398c379677 100644 (file)
--- a/src/mv.c
+++ b/src/mv.c
@@ -1,5 +1,5 @@
 /* mv -- move or rename files
-   Copyright (C) 86, 89, 90, 91, 1995-2002 Free Software Foundation, Inc.
+   Copyright (C) 86, 89, 90, 91, 1995-2003 Free Software Foundation, Inc.
 
    This program is free software; you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
@@ -445,7 +445,7 @@ main (int argc, char **argv)
        }
     }
 
-  n_files = argc - optind;
+  n_files = (optind < argc ? argc - optind : 0);
   file = argv + optind;
 
   target_directory_specified = (target_directory != NULL);