Initial revision
[nvi.git] / perl_scripts / make.pl
blob118dd99a424cc04314960ecb4b12432c87b2f637
1 sub make {
2 open MAKE, "make 2>&1 1>/dev/null |";
3 while(<MAKE>) {
4 if (($file, $line, $msg) = /([^: ]*):(\d*):(.+)/) {
5 if ($file == $prevfile && $line == $prevline) {
6 $error[-1]->[2] .= "\n$msg";
7 } else {
8 push @error, [$file, $line, $msg];
9 ($prevline, $prevfile) = ($line, $file);
13 close MAKE;
16 sub nexterror {
17 if ($index <= $#error) {
18 my $error = $error[$index++];
19 $curscr->Edit($error->[0]);
20 $curscr->SetCursor($error->[1],0);
21 $curscr->Msg($error->[2]);
25 # preverror is left as an exercise