From: Collin Funk Date: Fri, 20 Feb 2026 05:18:41 +0000 (-0800) Subject: maint: comm: prefer static initialization X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=dc0baaf4de2da367b2ac02e3d24db0c993bddcbd;p=thirdparty%2Fcoreutils.git maint: comm: prefer static initialization * src/comm.c (only_file_1, only_file_2, both): Initialize variables. (main): Remove unnecessary initializations. --- diff --git a/src/comm.c b/src/comm.c index 87cd65eb5b..8e671f40dd 100644 --- a/src/comm.c +++ b/src/comm.c @@ -40,13 +40,13 @@ static bool hard_LC_COLLATE; /* If true, print lines that are found only in file 1. */ -static bool only_file_1; +static bool only_file_1 = true; /* If true, print lines that are found only in file 2. */ -static bool only_file_2; +static bool only_file_2 = true; /* If true, print lines that are found in both files. */ -static bool both; +static bool both = true; /* If nonzero, we have seen at least one unpairable line. */ static bool seen_unpairable; @@ -434,15 +434,6 @@ main (int argc, char **argv) atexit (close_stdout); - only_file_1 = true; - only_file_2 = true; - both = true; - - seen_unpairable = false; - issued_disorder_warning[0] = issued_disorder_warning[1] = false; - check_input_order = CHECK_ORDER_DEFAULT; - total_option = false; - while ((c = getopt_long (argc, argv, "123z", long_options, NULL)) != -1) switch (c) {