From d61757486adf12ed4cb7cc112908aa2cf8a31f62 Mon Sep 17 00:00:00 2001 From: Pascal Rigaux Date: Tue, 1 Mar 2005 21:06:42 +0000 Subject: fix section with only comments (putting the comment after the EndSection is wrong) --- perl-install/Xconfig/parse.pm | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'perl-install') diff --git a/perl-install/Xconfig/parse.pm b/perl-install/Xconfig/parse.pm index d8c8057c6..609534b54 100644 --- a/perl-install/Xconfig/parse.pm +++ b/perl-install/Xconfig/parse.pm @@ -118,6 +118,7 @@ sub raw_to_string { my $s = do { if ($e->{l}) { my $inside = join('', map_index { raw_to_string($_, $::i) } @{$e->{l}}); + $inside .= $e->{post_comment} || ''; $inside =~ s/^/ /mg; qq(\n$e->{kind} "$e->{name}"\n) . $inside . "End$e->{kind}"; } else { @@ -126,7 +127,7 @@ sub raw_to_string { (defined $e->{val} ? ($e->{Option} && $e->{val} !~ /^"/ ? qq( "$e->{val}") : qq( $e->{val})) : ''); } }; - ($e->{pre_comment} ? ($b_want_spacing ? "\n" : '') . $e->{pre_comment} : '') . $s . ($e->{comment_on_line} || '') . "\n" . ($e->{post_comment} || ''); + ($e->{pre_comment} ? ($b_want_spacing ? "\n" : '') . $e->{pre_comment} : '') . $s . ($e->{comment_on_line} || '') . "\n" . (!$e->{l} && $e->{post_comment} || ''); } #-############################################################################### -- cgit v1.2.1