diff --git a/creduce/creduce.in b/creduce/creduce.in index ee86f24d..ea9a55bc 100644 --- a/creduce/creduce.in +++ b/creduce/creduce.in @@ -482,7 +482,7 @@ sub wait_helper() { my $exit_code; if ($proc->GetExitCode($exit_code) != Win32::Process::STILL_ACTIVE()) { - $? = ($exit_code == 0) ? 1 << 8 : 0; + $? = $exit_code << 8; return $proc->GetProcessID(); } push @procs, $proc; @@ -819,7 +819,7 @@ my @all_methods = ( { "name" => "pass_clang", "arg" => "remove-unused-function", "pri" => 220, "first_pass_pri" => 40, }, { "name" => "pass_clang", "arg" => "remove-unused-enum-member", "pri" => 221, "first_pass_pri" => 51, }, { "name" => "pass_clang", "arg" => "remove-enum-member-value", "pri" => 222, "first_pass_pri" => 52, }, - { "name" => "pass_clang_binsrch", "arg" => "remove-unused-var", "pri" => 223, "first_pass_pri" => 53, }, + { "name" => "pass_clang", "arg" => "remove-unused-var", "pri" => 223, "first_pass_pri" => 53, }, { "name" => "pass_clang", "arg" => "simplify-if", "pri" => 224, }, { "name" => "pass_clang", "arg" => "reduce-array-dim", "pri" => 225, }, { "name" => "pass_clang", "arg" => "reduce-array-size", "pri" => 226, }, diff --git a/creduce/pass_lines.pm b/creduce/pass_lines.pm index 8052f456..f884e7e9 100644 --- a/creduce/pass_lines.pm +++ b/creduce/pass_lines.pm @@ -81,10 +81,22 @@ sub transform ($$$) { if (defined($sh{"start"})) { print "***TRANSFORM START***\n" if $DEBUG; delete $sh{"start"}; - my $tmpfile = File::Temp::tmpnam(); - my $cmd = "$topformflat $arg < $cfile | grep -v '^\\s*\$' > $tmpfile"; + my $outfile = File::Temp::tmpnam(); + my $cmd = qq{"$topformflat $arg" < $cfile > $outfile}; print $cmd if $DEBUG; runit ($cmd); + + my $tmpfile = File::Temp::tmpnam(); + open INF_BLANK, "<$outfile" or die; + open OUTF_BLANK, ">$tmpfile" or die; + while (my $line = ) { + if($line !~ /^\s*$/) { + print OUTF_BLANK $line; + } + } + close INF_BLANK; + close OUTF_BLANK; + if (compare($cfile, $tmpfile) == 0) { # this is a gross hack to avoid tripping the # pass-didn't-modify-file check in the C-Reduce core, in