From 939f8bb6109d870978d7db849136c8a2aa945e4d Mon Sep 17 00:00:00 2001 From: minima Date: Sat, 3 Mar 2001 20:32:06 +0000 Subject: [PATCH] fix line beginning for > --- perl/winclient.pl | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/perl/winclient.pl b/perl/winclient.pl index e0c89efe..cf0da0a2 100755 --- a/perl/winclient.pl +++ b/perl/winclient.pl @@ -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; -- 2.43.0