From: Jim Meyering Date: Sat, 10 May 2003 13:30:26 +0000 (+0000) Subject: (main): Test for the case of no arguments before computing n_files. X-Git-Tag: v5.0.1~556 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=09196004812cdc0ac6aa2329e314a7e7bf6d6256;p=thirdparty%2Fcoreutils.git (main): Test for the case of no arguments before computing n_files. --- diff --git a/src/tail.c b/src/tail.c index e69470c240..c91b8d83fd 100644 --- a/src/tail.c +++ b/src/tail.c @@ -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;