summaryrefslogtreecommitdiff
path: root/src/tail.c
diff options
context:
space:
mode:
authorJim Meyering <jim@meyering.net>1996-04-20 03:43:10 +0000
committerJim Meyering <jim@meyering.net>1996-04-20 03:43:10 +0000
commit5ac0cdbfce66d50a38ef6a40d1a6ef2ac1bd09f7 (patch)
treebcd4ff899765d88d215bc55616f8b0dec7a9d04e /src/tail.c
parentb8654f033b64b882079c8d39b070d1c0ae5c88fd (diff)
downloadcoreutils-5ac0cdbfce66d50a38ef6a40d1a6ef2ac1bd09f7.tar.xz
(main): Make separation of case for n_files == 0 more clear.
Diffstat (limited to 'src/tail.c')
-rw-r--r--src/tail.c18
1 files changed, 11 insertions, 7 deletions
diff --git a/src/tail.c b/src/tail.c
index b158584b5..78b899ee5 100644
--- a/src/tail.c
+++ b/src/tail.c
@@ -847,7 +847,6 @@ main (int argc, char **argv)
off_t n_units = -1;
long int tmp_long;
int c; /* Option character. */
- int i;
int n_files;
char **file;
@@ -1006,13 +1005,18 @@ main (int argc, char **argv)
print_headers = 1;
if (n_files == 0)
- exit_status |= tail_file ("-", n_units, 0);
-
- for (i = 0; i < n_files; i++)
- exit_status |= tail_file (file[i], n_units, i);
+ {
+ exit_status |= tail_file ("-", n_units, 0);
+ }
+ else
+ {
+ int i;
+ for (i = 0; i < n_files; i++)
+ exit_status |= tail_file (file[i], n_units, i);
- if (forever_multiple)
- tail_forever (file, n_files);
+ if (forever_multiple)
+ tail_forever (file, n_files);
+ }
if (have_read_stdin && close (0) < 0)
error (EXIT_FAILURE, errno, "-");