Author: pfg
Date: Fri Jul 29 16:23:00 2016
New Revision: 303485
URL: https://svnweb.freebsd.org/changeset/base/303485

Log:
  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

Modified:
  head/usr.bin/indent/indent.c

Modified: head/usr.bin/indent/indent.c
==============================================================================
--- head/usr.bin/indent/indent.c        Fri Jul 29 16:17:54 2016        
(r303484)
+++ head/usr.bin/indent/indent.c        Fri Jul 29 16:23:00 2016        
(r303485)
@@ -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)
_______________________________________________
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"

Reply via email to