1
0
mirror of https://github.com/golang/go synced 2024-11-21 19:54:41 -07:00

errchk: fix build - allow matches in multiline error messages

TBR=r
CC=golang-dev
https://golang.org/cl/1734042
This commit is contained in:
Russ Cox 2010-06-20 12:05:43 -07:00
parent a212d174ac
commit 37c531f51f

View File

@ -31,7 +31,12 @@ close(SRC);
# Run command # Run command
$cmd = join(' ', @ARGV); $cmd = join(' ', @ARGV);
open(CMD, "exec $cmd </dev/null 2>&1 |") || die "BUG: errchk: run $cmd: $!"; open(CMD, "exec $cmd </dev/null 2>&1 |") || die "BUG: errchk: run $cmd: $!";
@out = grep { !/^ / } <CMD>;
# 6g error messages continue onto additional lines with leading tabs.
# Split the output at the beginning of each line that doesn't begin with a tab.
$out = join('', <CMD>);
@out = split(/^(?!\t)/m, $out);
close CMD; close CMD;
if($? == 0) { if($? == 0) {