X-Git-Url: http://gb7djk.dxcluster.net/gitweb/gitweb.cgi?a=blobdiff_plain;f=perl%2Fwinclient.pl;h=f7f264b9b7f1dd6d1687fb74b40266b9092da429;hb=5d2f2feddd2c756e43868f62f72b3c5033c3d3a7;hp=cf0da0a2ffef78deeceeac86b0356e9a8e3f64e1;hpb=939f8bb6109d870978d7db849136c8a2aa945e4d;p=spider.git diff --git a/perl/winclient.pl b/perl/winclient.pl index cf0da0a2..f7f264b9 100755 --- a/perl/winclient.pl +++ b/perl/winclient.pl @@ -70,20 +70,21 @@ die "can't fork: $!" unless defined($childpid = fork()); # the communication ..... if ($childpid) { - my ($lastend, $end); + my ($lastend, $end) = ("\n", "\n"); STDOUT->autoflush(1); while (defined (my $msg = <$handle>)) { my ($sort, $call, $line) = $msg =~ /^(\w)([^\|]+)\|(.*)$/; if ($sort eq 'Z') { kill 'TERM', $childpid; + exit(0); } elsif ($sort eq 'E' || $sort eq 'B') { ; } else { # newline ends all lines except a prompt $lastend = $end; $end = "\n"; - if ($line =~ /^$call de $mycall\s+\d+-\w\w\w-\d+\s+\d+Z >$/) { + if ($line =~ /^$call de $mycall\s+\d+-\w\w\w-\d+\s+\d+Z >$/o) { $end = ' '; } my $begin = ($lastend eq "\n") ? '' : "\n";