Module Name: src
Committed By: rillig
Date: Mon May 15 15:04:48 UTC 2023
Modified Files:
src/tests/usr.bin/indent: fmt_decl.c
Log Message:
tests/indent: demonstrate wrong spacing after function prototype
To generate a diff of this commit:
cvs rdiff -u -r1.39 -r1.40 src/tests/usr.bin/indent/fmt_decl.c
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: src/tests/usr.bin/indent/fmt_decl.c
diff -u src/tests/usr.bin/indent/fmt_decl.c:1.39 src/tests/usr.bin/indent/fmt_decl.c:1.40
--- src/tests/usr.bin/indent/fmt_decl.c:1.39 Mon May 15 14:55:47 2023
+++ src/tests/usr.bin/indent/fmt_decl.c Mon May 15 15:04:48 2023
@@ -1,4 +1,4 @@
-/* $NetBSD: fmt_decl.c,v 1.39 2023/05/15 14:55:47 rillig Exp $ */
+/* $NetBSD: fmt_decl.c,v 1.40 2023/05/15 15:04:48 rillig Exp $ */
/*
* Tests for declarations of global variables, external functions, and local
@@ -887,3 +887,35 @@ char *(*fn)(int, int) = NULL;
/* XXX: The parameter '(int)' is wrongly interpreted as a type cast. */
/* XXX: The parameter '(int, int)' is wrongly interpreted as a type cast. */
//indent run-equals-input -di0
+
+
+/*
+ * Depending on the line break in the function header, the spaces around the
+ * '||' operator were removed.
+ */
+//indent input
+bool is_identifier_start(char ch)
+{
+ return ch_isalpha(ch) || ch == '_';
+}
+
+bool
+is_identifier_start(char ch)
+{
+ return ch_isalpha(ch) || ch == '_';
+}
+//indent end
+
+//indent run
+bool
+is_identifier_start(char ch)
+{
+ return ch_isalpha(ch) || ch == '_';
+}
+
+bool
+is_identifier_start(char ch)
+{
+ return ch_isalpha(ch)||ch == '_';
+}
+//indent end