(main): Test for the case of no arguments before computing n_files.

This commit is contained in:
Jim Meyering committed 2003-05-10 13:30:26 +00:00
1 parent 3de521ebf9
commit 0919600481
1 file changed
+6 -3
+6 -3
View 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;