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:
+6
-3
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user