Source-Changes-HG archive

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

[src/trunk]: src/tests/usr.bin/indent tests/lint: use zero-indexed array in a...



details:   https://anonhg.NetBSD.org/src/rev/483a4aab94fa
branches:  trunk
changeset: 989868:483a4aab94fa
user:      rillig <rillig%NetBSD.org@localhost>
date:      Sun Oct 17 17:23:59 2021 +0000

description:
tests/lint: use zero-indexed array in awk test program

No functional change.

diffstat:

 tests/usr.bin/indent/t_options.sh |  8 ++++----
 1 files changed, 4 insertions(+), 4 deletions(-)

diffs (37 lines):

diff -r 5a15c6b39b67 -r 483a4aab94fa tests/usr.bin/indent/t_options.sh
--- a/tests/usr.bin/indent/t_options.sh Sun Oct 17 17:20:47 2021 +0000
+++ b/tests/usr.bin/indent/t_options.sh Sun Oct 17 17:23:59 2021 +0000
@@ -1,5 +1,5 @@
 #! /bin/sh
-# $NetBSD: t_options.sh,v 1.3 2021/10/17 17:20:47 rillig Exp $
+# $NetBSD: t_options.sh,v 1.4 2021/10/17 17:23:59 rillig Exp $
 #
 # Copyright (c) 2021 The NetBSD Foundation, Inc.
 # All rights reserved.
@@ -87,7 +87,7 @@
                cmd = ENVIRON["INDENT"]
                for (i = 3; i <= NF; i++)
                        cmd = cmd " " $i
-               for (i = 1; i <= in_lines_len; i++)
+               for (i = 0; i < in_lines_len; i++)
                        print in_lines[i] | cmd
                close(cmd)
                unused = 0
@@ -96,7 +96,7 @@
                cmd = ENVIRON["INDENT"]
                for (i = 3; i <= NF; i++)
                        cmd = cmd " " $i
-               for (i = 1; i <= in_lines_len; i++) {
+               for (i = 0; i < in_lines_len; i++) {
                        print in_lines[i] | cmd
                        print in_lines[i] > "expected.out"
                }
@@ -116,7 +116,7 @@
 }
 
 mode == "input" {
-       in_lines[++in_lines_len] = $0
+       in_lines[in_lines_len++] = $0
        input_all = input_all $0 "\n"
 }
 



Home | Main Index | Thread Index | Old Index