Skip to content

Commit

Permalink
Delete trailing whitespace from output.
Browse files Browse the repository at this point in the history
Reviewed-by: Tim Hudson <[email protected]>
  • Loading branch information
snhenson authored and mattcaswell committed Jan 22, 2015
1 parent 09f4d9c commit f9be4da
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions util/su-filter.pl
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
if($in_su == 1) {
if(/}(.*);/) {
$out .= $_;
print $out;
do_output($out);
$in_su = 0;
} elsif(/^ *\} [^\s]+(\[\d*\])* = \{/) {
$tststr = $1;
Expand All @@ -44,7 +44,7 @@
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]+ )?\{/) {
Expand All @@ -53,7 +53,7 @@
$out = $_;
next;
} else {
print $_;
do_output($_);
}
}

Expand Down Expand Up @@ -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;
}

0 comments on commit f9be4da

Please sign in to comment.