summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorrillig <rillig@NetBSD.org>2023-05-19 05:28:54 +0000
committerrillig <rillig@NetBSD.org>2023-05-19 05:28:54 +0000
commitffa87d85487ded5ba9d730bdc73e308bb64349f2 (patch)
treec0defe26fd84a92089f3c8e318bce61a20bb35eb
parent93dc650849c98c54c31aa9cbbce9affaaf649563 (diff)
cat: fix misleading indentation
Found by indent, but not by GCC 10. No binary change.
-rw-r--r--bin/cat/cat.c28
1 files changed, 13 insertions, 15 deletions
diff --git a/bin/cat/cat.c b/bin/cat/cat.c
index 563ba6388b9..600cc972b13 100644
--- a/bin/cat/cat.c
+++ b/bin/cat/cat.c
@@ -1,4 +1,4 @@
-/* $NetBSD: cat.c,v 1.57 2016/06/16 00:52:37 sevan Exp $ */
+/* $NetBSD: cat.c,v 1.58 2023/05/19 05:28:54 rillig Exp $ */
/*
* Copyright (c) 1989, 1993
@@ -44,7 +44,7 @@ __COPYRIGHT(
#if 0
static char sccsid[] = "@(#)cat.c 8.2 (Berkeley) 4/27/95";
#else
-__RCSID("$NetBSD: cat.c,v 1.57 2016/06/16 00:52:37 sevan Exp $");
+__RCSID("$NetBSD: cat.c,v 1.58 2023/05/19 05:28:54 rillig Exp $");
#endif
#endif /* not lint */
@@ -182,21 +182,19 @@ cook_buf(FILE *fp)
gobble = 1;
} else
gobble = 0;
- }
- if (nflag) {
- if (!bflag || ch != '\n') {
- (void)fprintf(stdout,
- "%6d\t", ++line);
- if (ferror(stdout))
- break;
- } else if (eflag) {
- (void)fprintf(stdout,
- "%6s\t", "");
- if (ferror(stdout))
- break;
- }
+ }
+ if (nflag) {
+ if (!bflag || ch != '\n') {
+ (void)fprintf(stdout, "%6d\t", ++line);
+ if (ferror(stdout))
+ break;
+ } else if (eflag) {
+ (void)fprintf(stdout, "%6s\t", "");
+ if (ferror(stdout))
+ break;
}
}
+ }
if (ch == '\n') {
if (eflag)
if (putchar('$') == EOF)