indent: fix spacing around '*' in declarations

This commit is contained in:
rillig 2023-05-23 06:43:19 +00:00
parent 756425c686
commit fadc996fc6
2 changed files with 6 additions and 5 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: fmt_decl.c,v 1.44 2023/05/23 06:18:00 rillig Exp $ */
/* $NetBSD: fmt_decl.c,v 1.45 2023/05/23 06:43:19 rillig Exp $ */
/*
* Tests for declarations of global variables, external functions, and local
@ -1005,8 +1005,7 @@ void
//indent run -ci4 -di0 -ndj -nlp
void
// $ FIXME: Wrong indentation, should be 0 instead.
// $ FIXME: Wrong spacing around '*'.
(error_at)(int msgid, const pos_t * pos, ...)
(error_at)(int msgid, const pos_t *pos, ...)
{
}
//indent end

View File

@ -1,4 +1,4 @@
/* $NetBSD: indent.c,v 1.305 2023/05/23 06:35:01 rillig Exp $ */
/* $NetBSD: indent.c,v 1.306 2023/05/23 06:43:19 rillig Exp $ */
/*-
* SPDX-License-Identifier: BSD-4-Clause
@ -38,7 +38,7 @@
*/
#include <sys/cdefs.h>
__RCSID("$NetBSD: indent.c,v 1.305 2023/05/23 06:35:01 rillig Exp $");
__RCSID("$NetBSD: indent.c,v 1.306 2023/05/23 06:43:19 rillig Exp $");
#include <sys/param.h>
#include <err.h>
@ -366,6 +366,8 @@ update_ps_decl_ptr(lexer_symbol lsym)
if (lsym == lsym_lparen_or_lbracket
&& ps.prev_token == lsym_for)
ps.decl_ptr = dp_start;
if (lsym == lsym_comma && ps.in_decl)
ps.decl_ptr = dp_start;
break;
}
}