mirror of
https://github.com/radareorg/radare2
synced 2026-08-22 20:23:32 -04:00
40 lines
688 B
Perl
Executable file
40 lines
688 B
Perl
Executable file
#!/usr/bin/perl
|
|
use strict;
|
|
use warnings;
|
|
|
|
if (@ARGV) {
|
|
foreach my $file (@ARGV) {
|
|
open my $fh, '<', $file or die "Cannot open $file: $!";
|
|
my @lines = <$fh>;
|
|
close $fh;
|
|
|
|
foreach my $line (@lines) {
|
|
$line =~ s/^ +/\t/g;
|
|
if ($line =~ /^[A-Za-z0-9]/) {
|
|
$line =~ s/\s*\(/(/g;
|
|
} else {
|
|
if (!($line =~/define/)) {
|
|
$line =~ s/\s*\(/ (/g;
|
|
}
|
|
}
|
|
$line =~ s/'\s\(/'(/g;
|
|
$line =~ s/\(\s\(/((/g;
|
|
}
|
|
|
|
open my $out, '>', $file or die "Cannot write to $file: $!";
|
|
print $out @lines;
|
|
close $out;
|
|
}
|
|
} else {
|
|
while (<>) {
|
|
s/^ +/\t/g;
|
|
if (/^[A-Za-z0-9]/) {
|
|
s/\s*\(/(/g;
|
|
} else {
|
|
s/\s*\(/ (/g;
|
|
}
|
|
s/'\s\(/'(/g;
|
|
s/\(\s\(/((/g;
|
|
print;
|
|
}
|
|
}
|