From d95df4602737d4ad35e1b93e773e434c70ac5be5 Mon Sep 17 00:00:00 2001 From: djk Date: Mon, 12 Jun 2000 11:54:51 +0000 Subject: [PATCH] kludge spurious \x00 between \r and \n (artifact from Net::Telnet?) --- perl/client.pl | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/perl/client.pl b/perl/client.pl index 4a472984..1b6757b4 100755 --- a/perl/client.pl +++ b/perl/client.pl @@ -178,8 +178,9 @@ sub rec_stdin cease(1); } elsif ($r > 0) { if ($mode) { - $buf =~ s/\r/\n/og if $mode == 1; - $buf =~ s/\r\n/\n/og if $mode == 2; + $buf =~ s/\r/\n/g if $mode == 1; + $buf =~ s/[\r\x00]//g if $mode == 2; + $dangle = !($buf =~ /\n$/); if ($buf eq "\n") { @lines = (" "); @@ -278,7 +279,7 @@ sub dochat dbg('connect', "received 0 length line, aborting..."); cease(11); } - $line =~ s/\r\n/\n/og; + $line =~ s/\r//g; chomp; } elsif ($csort eq 'ax25' || $csort eq 'prog') { local $/ = "\r"; @@ -287,7 +288,8 @@ sub dochat dbg('connect', "received 0 length line, aborting..."); cease(11); } - $line =~ s/\r//og; + $line =~ s/\r/\n/g; + chomp; } dbg('connect', "received \"$line\""); if ($abort && $line =~ /$abort/i) { -- 2.43.0