X-Git-Url: https://git.openssl.org/gitweb/?p=openssl.git;a=blobdiff_plain;f=util%2Fsu-filter.pl;fp=util%2Fsu-filter.pl;h=8975af64f95c238c8613cc65f9106b5aa3566c0a;hp=854644bb333442d5aeee6e54c619697f9246b643;hb=f9be4da00e0db2f23c0d888b4c9e0727b8d0f20b;hpb=09f4d9c0f972a366ec5cfda44243a1ac77ac395a diff --git a/util/su-filter.pl b/util/su-filter.pl index 854644bb33..8975af64f9 100644 --- a/util/su-filter.pl +++ b/util/su-filter.pl @@ -21,7 +21,7 @@ while(<>) { if($in_su == 1) { if(/}(.*);/) { $out .= $_; - print $out; + do_output($out); $in_su = 0; } elsif(/^ *\} [^\s]+(\[\d*\])* = \{/) { $tststr = $1; @@ -44,7 +44,7 @@ while(<>) { my @strucdata = structureData($data); $out .= displayData($indent, 0, \@strucdata); $out .= "\n$indent};\n"; - print $out; + do_output($out); $in_su = 0; } } elsif($incomm <= 0 && /( *)(static )?(const )?(union|struct) ([^\s]+ )?\{/) { @@ -53,7 +53,7 @@ while(<>) { $out = $_; next; } else { - print $_; + do_output($_); } } @@ -251,3 +251,10 @@ sub displayData { } return $out; } + +sub do_output { + my $out = shift; + # Strip any trailing whitespace + $out =~ s/\s+\n/\n/g; + print $out; +}