Skip to content

Commit

Permalink
fix Bug 1950 . the improved text filtering killed the safety logic. w…
Browse files Browse the repository at this point in the history
…ow. we’ve been running blind since Dec 6.
  • Loading branch information
RussTedrake committed Jan 29, 2014
1 parent d487e10 commit 4633126
Showing 1 changed file with 10 additions and 11 deletions.
21 changes: 10 additions & 11 deletions cmake/matlab_clean.pl
Original file line number Diff line number Diff line change
Expand Up @@ -8,23 +8,22 @@
# This appears to be a necessary evil to get clean matlab output to ctest:
# http://www.mail-archive.com/[email protected]/msg02175.html

#use lib "./Text-Unidecode-0.04/lib";
#use Text::Unidecode;

my $cmd = 'matlab';
foreach my $a(@ARGV) {
$cmd .= " \"$a\"";
}
$cmd .= ' 2>&1 ';

# use a pipe so as not to buffer output. in case matlab takes a vacation midstream
open(my $command_stream, "-|", $cmd);
while(<$command_stream>){
# le junque. on separate lines for readability
$_ =~ s/.*exclude an item from Time Machine.*\n//g;
$_ =~ s/[^\x{0009}\x{000a}\x{000d}\x{0020}-\x{D7FF}\x{E000}-\x{FFFD}]+//g;
$_ =~ s/\x1b\[\?1h//g;
$_ =~ s/\x1b=//g;
$_ =~ s/\x1b\[\?1l\x1b>//g;
print;
}
my $matlab_output = `$cmd`;
my $retval = $? >> 8;

$matlab_output =~ s/.*exclude an item from Time Machine.*\n//g;
#$matlab_output = unidecode($matlab_output); # didn't seem to help
$matlab_output =~ s/[^\x{0009}\x{000a}\x{000d}\x{0020}-\x{D7FF}\x{E000}-\x{FFFD}]+//g;

print($matlab_output);
exit($retval);

0 comments on commit 4633126

Please sign in to comment.