fixed lines in messages containing just '0'
authorminima <minima>
Tue, 20 Aug 2002 17:35:16 +0000 (17:35 +0000)
committerminima <minima>
Tue, 20 Aug 2002 17:35:16 +0000 (17:35 +0000)
Changes
perl/DXProtout.pm
perl/DXUtil.pm
perl/console.pl

diff --git a/Changes b/Changes
index dfb911b020df36a67a49bbbb8c0d200ad1b8f55b..6610c12c1102c72a73b36b63435f5620cf77cd41 100644 (file)
--- 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=======================================================================
index c87e96ca8f4378d2e97d70b2b72009bb8ef46c79..80b1a5d6eeb916b94fd45bfc1f215bedd627746c 100644 (file)
@@ -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^~";
 }
index 3b701ebbc6da5b83953782c99e14fc9a6d4d548e..e497a6e9df6c2febbca7c1aa3354ef2e234f7d11 100644 (file)
@@ -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 */-)
index 205d52f379d37b19cf9cba49093f400a00f3a6ff..46e7a1ea6c1df7c9c8eb4e2ba09f43edd26892cc 100755 (executable)
@@ -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;