提交 f9be4da0 编写于 作者: D Dr. Stephen Henson 提交者: Matt Caswell

Delete trailing whitespace from output.

Reviewed-by: NTim Hudson <tjh@openssl.org>
上级 09f4d9c0
...@@ -21,7 +21,7 @@ while(<>) { ...@@ -21,7 +21,7 @@ while(<>) {
if($in_su == 1) { if($in_su == 1) {
if(/}(.*);/) { if(/}(.*);/) {
$out .= $_; $out .= $_;
print $out; do_output($out);
$in_su = 0; $in_su = 0;
} elsif(/^ *\} [^\s]+(\[\d*\])* = \{/) { } elsif(/^ *\} [^\s]+(\[\d*\])* = \{/) {
$tststr = $1; $tststr = $1;
...@@ -44,7 +44,7 @@ while(<>) { ...@@ -44,7 +44,7 @@ while(<>) {
my @strucdata = structureData($data); my @strucdata = structureData($data);
$out .= displayData($indent, 0, \@strucdata); $out .= displayData($indent, 0, \@strucdata);
$out .= "\n$indent};\n"; $out .= "\n$indent};\n";
print $out; do_output($out);
$in_su = 0; $in_su = 0;
} }
} elsif($incomm <= 0 && /( *)(static )?(const )?(union|struct) ([^\s]+ )?\{/) { } elsif($incomm <= 0 && /( *)(static )?(const )?(union|struct) ([^\s]+ )?\{/) {
...@@ -53,7 +53,7 @@ while(<>) { ...@@ -53,7 +53,7 @@ while(<>) {
$out = $_; $out = $_;
next; next;
} else { } else {
print $_; do_output($_);
} }
} }
...@@ -251,3 +251,10 @@ sub displayData { ...@@ -251,3 +251,10 @@ sub displayData {
} }
return $out; return $out;
} }
sub do_output {
my $out = shift;
# Strip any trailing whitespace
$out =~ s/\s+\n/\n/g;
print $out;
}
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册