Module Name:    src
Committed By:   rillig
Date:           Sun Dec  3 20:42:32 UTC 2023

Modified Files:
        src/usr.bin/indent: lexi.c

Log Message:
indent: fix line number counting in function definition

In a function definition that is split on two lines, if the first line
ends with a '*', the following line break didn't include the line
number.


To generate a diff of this commit:
cvs rdiff -u -r1.239 -r1.240 src/usr.bin/indent/lexi.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/lexi.c
diff -u src/usr.bin/indent/lexi.c:1.239 src/usr.bin/indent/lexi.c:1.240
--- src/usr.bin/indent/lexi.c:1.239	Mon Jun 26 20:23:40 2023
+++ src/usr.bin/indent/lexi.c	Sun Dec  3 20:42:31 2023
@@ -1,4 +1,4 @@
-/*	$NetBSD: lexi.c,v 1.239 2023/06/26 20:23:40 rillig Exp $	*/
+/*	$NetBSD: lexi.c,v 1.240 2023/12/03 20:42:31 rillig Exp $	*/
 
 /*-
  * SPDX-License-Identifier: BSD-4-Clause
@@ -38,7 +38,7 @@
  */
 
 #include <sys/cdefs.h>
-__RCSID("$NetBSD: lexi.c,v 1.239 2023/06/26 20:23:40 rillig Exp $");
+__RCSID("$NetBSD: lexi.c,v 1.240 2023/12/03 20:42:31 rillig Exp $");
 
 #include <stdlib.h>
 #include <string.h>
@@ -523,6 +523,8 @@ lex_asterisk_unary(void)
 	while (*inp_p == '*' || ch_isspace(*inp_p)) {
 		if (*inp_p == '*')
 			token_add_char('*');
+		if (*inp_p == '\n')
+			line_no++;
 		inp_skip();
 	}
 

Reply via email to