]> git.ipfire.org Git - thirdparty/coreutils.git/commitdiff
(main): Test for the case of no arguments before computing n_files.
authorJim Meyering <jim@meyering.net>
Sat, 10 May 2003 13:30:26 +0000 (13:30 +0000)
committerJim Meyering <jim@meyering.net>
Sat, 10 May 2003 13:30:26 +0000 (13:30 +0000)
src/tail.c

index e69470c24034120e68ba9467a26836f57df6ab63..c91b8d83fd4aa6655ebe50446d2d1d166d46cc9d 100644 (file)
@@ -1624,10 +1624,13 @@ main (int argc, char **argv)
        --n_units;
     }
 
-  n_files = argc - optind;
-  file = argv + optind;
 
-  if (n_files == 0)
+  if (optind < argc)
+    {
+      n_files = argc - optind;
+      file = argv + optind;
+    }
+  else
     {
       static char *dummy_stdin = "-";
       n_files = 1;