Permalink
Browse files

Indent before writing the extra tokens

This fixes cases where there are interleaved preprocessor line
comments in structs with designated initializers (pcmdec.c with
gcc). Before this, the starting # was written at the end of the
previous line.
  • Loading branch information...
mstorsjo committed Sep 7, 2012
1 parent 7b1ee64 commit 101d658c14db44be4fb819d94097cc54d2de6214
Showing with 2 additions and 0 deletions.
  1. +2 −0 convert.c
View
@@ -2137,6 +2137,8 @@ static void replace_struct_array(unsigned *_saidx, unsigned *_clidx, unsigned *e
if (is_union) // Unions should be initialized by only one element
break;
if (n < indent_token_end)
indent_for_token(tokens[n], lnum, cpos, &off);
for (; n < indent_token_end; n++) {
print_token(tokens[n], lnum, cpos);
indent_for_token(tokens[n + 1], lnum, cpos, &off);

0 comments on commit 101d658

Please sign in to comment.