summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorrillig <rillig@NetBSD.org>2023-06-09 08:16:06 +0000
committerrillig <rillig@NetBSD.org>2023-06-09 08:16:06 +0000
commit3fbb385bf4682cb12c8e5aa2bb1eb00f446faade (patch)
tree8e4ea25ed7d28201019b087db09f8a694199521d
parentf4bb42f133bbba65686bfd07d76a33ddc9641897 (diff)
indent: eliminate unused variable
No functional change.
-rw-r--r--usr.bin/indent/indent.c16
1 files changed, 6 insertions, 10 deletions
diff --git a/usr.bin/indent/indent.c b/usr.bin/indent/indent.c
index d37b87da95b..808d76b87ea 100644
--- a/usr.bin/indent/indent.c
+++ b/usr.bin/indent/indent.c
@@ -1,4 +1,4 @@
-/* $NetBSD: indent.c,v 1.343 2023/06/09 08:10:58 rillig Exp $ */
+/* $NetBSD: indent.c,v 1.344 2023/06/09 08:16:06 rillig Exp $ */
/*-
* SPDX-License-Identifier: BSD-4-Clause
@@ -38,7 +38,7 @@
*/
#include <sys/cdefs.h>
-__RCSID("$NetBSD: indent.c,v 1.343 2023/06/09 08:10:58 rillig Exp $");
+__RCSID("$NetBSD: indent.c,v 1.344 2023/06/09 08:16:06 rillig Exp $");
#include <sys/param.h>
#include <err.h>
@@ -92,7 +92,6 @@ FILE *input;
FILE *output;
static const char *in_name = "Standard Input";
-static const char *out_name = "Standard Output";
static const char *backup_suffix = ".BAK";
static char bakfile[MAXPATHLEN] = "";
@@ -259,12 +258,11 @@ parse_command_line(int argc, char **argv)
err(1, "%s", in_name);
} else if (output == NULL) {
- out_name = arg;
- if (strcmp(in_name, out_name) == 0)
+ if (strcmp(arg, in_name) == 0)
errx(1, "input and output files "
"must be different");
- if ((output = fopen(out_name, "w")) == NULL)
- err(1, "%s", out_name);
+ if ((output = fopen(arg, "w")) == NULL)
+ err(1, "%s", arg);
} else
errx(1, "too many arguments: %s", arg);
@@ -273,10 +271,8 @@ parse_command_line(int argc, char **argv)
if (input == NULL) {
input = stdin;
output = stdout;
- } else if (output == NULL) {
- out_name = in_name;
+ } else if (output == NULL)
bakcopy();
- }
if (opt.comment_column <= 1)
opt.comment_column = 2; /* don't put normal comments in column