summaryrefslogtreecommitdiff
path: root/indent.c
diff options
context:
space:
mode:
authorTom Lane2017-06-20 19:45:41 +0000
committerTom Lane2017-06-20 19:45:41 +0000
commitb3b581502dbf2804bc16fc99089d53811f5ef7ee (patch)
treeb33d4672182cd8da2d95990cbbf6b60fa179a0fe /indent.c
parentdc8b3f67104281db426fe1c4676440e65b92d32b (diff)
Adjust in_decl logic to avoid messing up enum declarations.
This is a workaround for an acknowledged upstream bug; it basically reverts this logic to the way it was in NetBSD indent. While there may eventually be a different upstream fix, this will do for our purposes. Add a regression test case that illustrates the problem, and tweak declarations.0.stdout for slightly different formatting produced for a function pointer typedef.
Diffstat (limited to 'indent.c')
-rw-r--r--indent.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/indent.c b/indent.c
index e6560af..9faf57a 100644
--- a/indent.c
+++ b/indent.c
@@ -931,7 +931,7 @@ check_type:
}
ps.in_or_st = true; /* this might be a structure or initialization
* declaration */
- ps.in_decl = ps.decl_on_line = ps.last_token != type_def;
+ ps.in_decl = ps.decl_on_line = true;
if ( /* !ps.in_or_st && */ ps.dec_nest <= 0)
ps.just_saw_decl = 2;
prefix_blankline_requested = 0;