Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/bin/cat cat: fix misleading indentation



details:   https://anonhg.NetBSD.org/src/rev/7cf528b9c371
branches:  trunk
changeset: 375881:7cf528b9c371
user:      rillig <rillig%NetBSD.org@localhost>
date:      Fri May 19 05:28:54 2023 +0000

description:
cat: fix misleading indentation

Found by indent, but not by GCC 10.

No binary change.

diffstat:

 bin/cat/cat.c |  28 +++++++++++++---------------
 1 files changed, 13 insertions(+), 15 deletions(-)

diffs (51 lines):

diff -r 906e209ac57a -r 7cf528b9c371 bin/cat/cat.c
--- a/bin/cat/cat.c     Thu May 18 19:08:16 2023 +0000
+++ b/bin/cat/cat.c     Fri May 19 05:28:54 2023 +0000
@@ -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 @@
 #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)



Home | Main Index | Thread Index | Old Index