]> Cypherpunks repositories - gostls13.git/commitdiff
errchk: fix build - allow matches in multiline error messages
authorRuss Cox <rsc@golang.org>
Sun, 20 Jun 2010 19:05:43 +0000 (12:05 -0700)
committerRuss Cox <rsc@golang.org>
Sun, 20 Jun 2010 19:05:43 +0000 (12:05 -0700)
TBR=r
CC=golang-dev
https://golang.org/cl/1734042

test/errchk

index 3aafddb82d4b6e4291d1bc17043cf9da1030cbe6..115aa7be097fa51b200c8975c0090969e15838a4 100755 (executable)
@@ -31,7 +31,12 @@ close(SRC);
 # Run command
 $cmd = join(' ', @ARGV);
 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;
 
 if($? == 0) {