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

src/csplit.c

index 1f0253c3c1bd8548dafe6b69d3c7b36423bb1a56..d453afbbf86cbb9b8f5bfa4edc8bc20821eb27d9 100644 (file)
@@ -132,7 +132,7 @@ static bool have_read_eof = false;
 static char *volatile filename_space = NULL;
 
 /* Prefix part of output file names. */
-static char const *volatile prefix = NULL;
+static char const *volatile prefix = DEFAULT_PREFIX;
 
 /* Suffix part of output file names. */
 static char *volatile suffix = NULL;
@@ -159,7 +159,7 @@ static char **global_argv;
 static bool suppress_count;
 
 /* If true, remove output files on error. */
-static bool volatile remove_files;
+static bool volatile remove_files = true;
 
 /* If true, remove all output files which have a zero length. */
 static bool elide_empty_files;
@@ -1292,12 +1292,6 @@ main (int argc, char **argv)
   atexit (close_stdout);
 
   global_argv = argv;
-  controls = NULL;
-  control_used = 0;
-  suppress_count = false;
-  remove_files = true;
-  suppress_matched = false;
-  prefix = DEFAULT_PREFIX;
 
   while ((optc = getopt_long (argc, argv, "f:b:kn:sqz", longopts, NULL))
          != -1)