1
0
mirror of git://git.sv.gnu.org/coreutils.git synced 2026-08-14 06:03:46 +02:00

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

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