a mostly working send message implementation
[spider.git] / perl / client.pl
index 2a41c221320fbef8120d2af0598a69f6da5be6be..834aaf37ce2e33a019987e1ad2b4fe0d8fc1c653 100755 (executable)
@@ -39,6 +39,7 @@ BEGIN {
 
 use Msg;
 use DXVars;
+use Carp;
 
 $mode = 2;                      # 1 - \n = \r as EOL, 2 - \n = \n, 0 - transparent
 $call = "";                     # the callsign being used
@@ -147,7 +148,11 @@ sub rec_stdin
     if ($mode) {
          $buf =~ s/\r/\n/og if $mode == 1;
          $dangle = !($buf =~ /\n$/);
-         @lines = split /\n/, $buf;
+         if ($buf eq "\n") {
+           @lines = (" ");
+         } else {
+           @lines = split /\n/, $buf;
+         }
          if ($dangle) {                # pull off any dangly bits
            $buf = pop @lines;
          } else {