]> git.ipfire.org Git - thirdparty/coreutils.git/commitdiff
maint: head: prefer static initialization
authorCollin Funk <collin.funk1@gmail.com>
Fri, 20 Feb 2026 04:33:10 +0000 (20:33 -0800)
committerCollin Funk <collin.funk1@gmail.com>
Fri, 20 Feb 2026 04:36:56 +0000 (20:36 -0800)
* src/head.c (line_end): Initialize variable.
(main): Remove unnecessary initializations.

src/head.c

index 704be33be712c610bf1b505cd3af3eb0427e1cdc..e6596ecbe132e7f781c73a4f98dda2e0e75bcbf8 100644 (file)
@@ -58,7 +58,7 @@ static bool presume_input_pipe;
 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
@@ -943,12 +943,6 @@ main (int argc, char **argv)
 
   atexit (close_stdout);
 
-  have_read_stdin = false;
-
-  print_headers = false;
-
-  line_end = '\n';
-
   if (1 < argc && argv[1][0] == '-' && c_isdigit (argv[1][1]))
     {
       char *a = argv[1];