From 5c15f6e5521944f56427ef069f449739ce84ce9f Mon Sep 17 00:00:00 2001 From: minima Date: Tue, 20 Aug 2002 17:35:16 +0000 Subject: [PATCH] fixed lines in messages containing just '0' --- Changes | 3 +++ perl/DXProtout.pm | 2 +- perl/DXUtil.pm | 3 ++- perl/console.pl | 6 +++--- 4 files changed, 9 insertions(+), 5 deletions(-) diff --git a/Changes b/Changes index dfb911b0..6610c12c 100644 --- a/Changes +++ b/Changes @@ -1,3 +1,6 @@ +20Aug02======================================================================= +1. fix lines containing just the character '0' in messages (and console.pl) +(K1XX). 06Aug02======================================================================= 1. added 5.5Mhz band as '60m'. 29Jul02======================================================================= diff --git a/perl/DXProtout.pm b/perl/DXProtout.pm index c87e96ca..80b1a5d6 100644 --- a/perl/DXProtout.pm +++ b/perl/DXProtout.pm @@ -210,7 +210,7 @@ sub pc28 sub pc29 { my ($fromnode, $tonode, $stream, $text) = @_; - $text = ' ' unless $text && length $text > 0; + $text = ' ' unless defined $text && length $text > 0; $text =~ s/\^/%5E/og; # remove ^ return "PC29^$fromnode^$tonode^$stream^$text^~"; } diff --git a/perl/DXUtil.pm b/perl/DXUtil.pm index 3b701ebb..e497a6e9 100644 --- a/perl/DXUtil.pm +++ b/perl/DXUtil.pm @@ -346,8 +346,9 @@ sub is_callsign # check that a PC protocol field is valid text sub is_pctext { + return undef unless length $_[0]; return undef if $_[0] =~ /[\x00-\x08\x0a-\x1f\x80-\x9f]/; - return $_[0]; + return 1; } # check that a PC prot flag is fairly valid (doesn't check the difference between 1/0 and */-) diff --git a/perl/console.pl b/perl/console.pl index 205d52f3..46e7a1ea 100755 --- a/perl/console.pl +++ b/perl/console.pl @@ -278,7 +278,7 @@ sub rec_stdin if ($r eq KEY_ENTER || $r eq "\n" || $r eq "\r") { # save the lines - $inbuf = " " unless length($inbuf); + $inbuf = " " unless length $inbuf; # check for a pling and do a search back for a command if ($inbuf =~ /^!/o) { @@ -295,7 +295,7 @@ sub rec_stdin return; } } - push @khistory, $inbuf if $inbuf; + push @khistory, $inbuf if length $inbuf; shift @khistory if @khistory > $maxkhist; $khistpos = @khistory; $bot->move(0,0); @@ -397,7 +397,7 @@ sub rec_stdin } elsif ($r eq KEY_RESIZE || $r eq "\0632") { do_resize(); return; - } elsif (defined is_pctext($r)) { + } elsif (defined $r && is_pctext($r)) { # move the top screen back to the bottom if you type something if ($spos < @shistory) { $spos = @shistory; -- 2.43.0