Module Name: src
Committed By: rillig
Date: Sun Feb 13 12:48:12 UTC 2022
Modified Files:
src/usr.bin/indent: io.c
Log Message:
indent: consistently use nparen for indexing parser_state.paren
No binary change.
To generate a diff of this commit:
cvs rdiff -u -r1.146 -r1.147 src/usr.bin/indent/io.c
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: src/usr.bin/indent/io.c
diff -u src/usr.bin/indent/io.c:1.146 src/usr.bin/indent/io.c:1.147
--- src/usr.bin/indent/io.c:1.146 Sun Feb 13 12:43:26 2022
+++ src/usr.bin/indent/io.c Sun Feb 13 12:48:12 2022
@@ -1,4 +1,4 @@
-/* $NetBSD: io.c,v 1.146 2022/02/13 12:43:26 rillig Exp $ */
+/* $NetBSD: io.c,v 1.147 2022/02/13 12:48:12 rillig Exp $ */
/*-
* SPDX-License-Identifier: BSD-4-Clause
@@ -43,7 +43,7 @@ static char sccsid[] = "@(#)io.c 8.1 (Be
#include <sys/cdefs.h>
#if defined(__NetBSD__)
-__RCSID("$NetBSD: io.c,v 1.146 2022/02/13 12:43:26 rillig Exp $");
+__RCSID("$NetBSD: io.c,v 1.147 2022/02/13 12:48:12 rillig Exp $");
#elif defined(__FreeBSD__)
__FBSDID("$FreeBSD: head/usr.bin/indent/io.c 334927 2018-06-10 16:44:18Z pstef $");
#endif
@@ -573,9 +573,9 @@ output_complete_line(char line_terminato
ps.ind_level = ps.ind_level_follow;
ps.line_start_nparen = ps.nparen;
- if (ps.line_start_nparen > 0) {
+ if (ps.nparen > 0) {
/* TODO: explain what negative indentation means */
- paren_indent = -1 - ps.paren[ps.line_start_nparen - 1].indent;
+ paren_indent = -1 - ps.paren[ps.nparen - 1].indent;
debug_println("paren_indent is now %d", paren_indent);
}