From 2f9ba63b3bb6930fe448ea1e97c1a77d56de8551 Mon Sep 17 00:00:00 2001 From: pfg Date: Fri, 29 Jul 2016 16:23:00 +0000 Subject: [PATCH] indent(1): fix struct termination detection. Semicolons inside struct declarations don't end the declarations. Differential Revision: https://reviews.freebsd.org/D6966 (Partial) Obtained from: Piotr Stefaniak --- usr.bin/indent/indent.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/usr.bin/indent/indent.c b/usr.bin/indent/indent.c index 046f1bfbb5c..33c5bcff6fd 100644 --- a/usr.bin/indent/indent.c +++ b/usr.bin/indent/indent.c @@ -701,8 +701,10 @@ check_type: break; case semicolon: /* got a ';' */ - ps.in_or_st = false;/* we are not in an initialization or - * structure declaration */ + if (ps.dec_nest == 0) { + /* we are not in an initialization or structure declaration */ + ps.in_or_st = false; + } scase = false; /* these will only need resetting in an error */ squest = 0; if (ps.last_token == rparen && rparen_count == 0) -- 2.11.4.GIT