fix line beginning for >
authorminima <minima>
Sat, 3 Mar 2001 20:32:06 +0000 (20:32 +0000)
committerminima <minima>
Sat, 3 Mar 2001 20:32:06 +0000 (20:32 +0000)
perl/winclient.pl

index e0c89efe4174a3e21b5a228794fd97a96b108554..cf0da0a2ffef78deeceeac86b0356e9a8e3f64e1 100755 (executable)
@@ -70,6 +70,8 @@ die "can't fork: $!" unless defined($childpid = fork());
 
 # the communication .....
 if ($childpid) {
+       my ($lastend, $end);
+       
        STDOUT->autoflush(1);
     while (defined (my $msg = <$handle>)) {
                my ($sort, $call, $line) = $msg =~ /^(\w)([^\|]+)\|(.*)$/;
@@ -79,11 +81,13 @@ if ($childpid) {
                        ;
                } else {
                        # newline ends all lines except a prompt
-                       my $end = "\n";
+                       $lastend = $end;
+                       $end = "\n";
                        if ($line =~ /^$call de $mycall\s+\d+-\w\w\w-\d+\s+\d+Z >$/) {
                                $end = ' ';
                        }
-                       print $line . $end;
+                       my $begin = ($lastend eq "\n") ? '' : "\n";
+                       print $begin . $line . $end;
                }
     }
     kill 'TERM', $childpid;