diff options
| author | Collin Funk <collin.funk1@gmail.com> | 2026-02-19 21:18:41 -0800 |
|---|---|---|
| committer | Collin Funk <collin.funk1@gmail.com> | 2026-02-19 21:18:41 -0800 |
| commit | dc0baaf4de2da367b2ac02e3d24db0c993bddcbd (patch) | |
| tree | 21a051295fcf5f63aa1b42af8ea0f2e152e5f430 /src | |
| parent | ecf3f98eec0ce8e7991fd4956374b604527c80da (diff) | |
| download | coreutils-dc0baaf4de2da367b2ac02e3d24db0c993bddcbd.tar.gz coreutils-dc0baaf4de2da367b2ac02e3d24db0c993bddcbd.zip | |
maint: comm: prefer static initialization
* src/comm.c (only_file_1, only_file_2, both): Initialize variables.
(main): Remove unnecessary initializations.
Diffstat (limited to 'src')
| -rw-r--r-- | src/comm.c | 15 |
1 files changed, 3 insertions, 12 deletions
diff --git a/src/comm.c b/src/comm.c index 87cd65eb5..8e671f40d 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) { |
