]> git.ipfire.org Git - thirdparty/coreutils.git/commitdiff
maint: tail: prefer static initialization
authorCollin Funk <collin.funk1@gmail.com>
Fri, 20 Feb 2026 05:24:54 +0000 (21:24 -0800)
committerCollin Funk <collin.funk1@gmail.com>
Fri, 20 Feb 2026 05:24:54 +0000 (21:24 -0800)
* src/tail.c (count_lines, line_end): Initialize variables.
(main): Remove unnecessary initializations.

src/tail.c

index c0d4e0329ee336e0a83b97c19508bcb76cfa3b2e..2bc29cb5de04f61f54b3c50efbac35da95ef5b88 100644 (file)
@@ -177,7 +177,7 @@ static bool reopen_inaccessible_files;
 
 /* If true, interpret the numeric argument as the number of lines.
    Otherwise, interpret it as the number of bytes.  */
-static bool count_lines;
+static bool count_lines = true;
 
 /* Whether we follow the name of each file or the file descriptor
    that is initially associated with each name.  */
@@ -196,7 +196,7 @@ static bool from_start;
 static bool print_headers;
 
 /* Character to split lines by. */
-static char line_end;
+static char line_end = '\n';
 
 /* When to print the filename banners.  */
 enum header_mode
@@ -2376,11 +2376,6 @@ main (int argc, char **argv)
     page_size = p;
   }
 
-  have_read_stdin = false;
-
-  count_lines = true;
-  forever = from_start = print_headers = false;
-  line_end = '\n';
   obsolete_option = parse_obsolete_option (argc, argv, &n_units);
   argc -= obsolete_option;
   argv += obsolete_option;