diff options
author | Dr. Stephen Henson <steve@openssl.org> | 2015-01-21 15:32:54 +0000 |
---|---|---|
committer | Matt Caswell <matt@openssl.org> | 2015-01-22 09:45:40 +0000 |
commit | 7b0ec6a4afee0cdf65ad8cf4dab186b40f3df173 (patch) | |
tree | 5c0bf20cd55e2eebff28d2984142bebb29d6ed79 | |
parent | e5ebff7b6a1ecce5863e992fe12a56a1c233d07a (diff) |
Delete trailing whitespace from output.
Reviewed-by: Tim Hudson <tjh@openssl.org>
-rw-r--r-- | util/su-filter.pl | 13 |
1 files changed, 10 insertions, 3 deletions
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; +} |