move the handling of unprintable characters out of IntMsg
authorminima <minima>
Wed, 14 Nov 2001 14:13:31 +0000 (14:13 +0000)
committerminima <minima>
Wed, 14 Nov 2001 14:13:31 +0000 (14:13 +0000)
Changes
perl/DXUtil.pm
perl/IntMsg.pm
perl/console.pl

diff --git a/Changes b/Changes
index bf7b49c8f5890ac9e256b7de574c6a7438f2db2a..632c9b16dd6c03b99158bf6ec024ad66e6d0974e 100644 (file)
--- a/Changes
+++ b/Changes
@@ -1,6 +1,7 @@
 14Nov01=======================================================================
 1. make the number of characters of the dx comment dependant on the type of
 connection. This should mean that 'legacy' user programs can cope.
+2. move the handling of unprintable characters out of IntMsg
 07Nov01=======================================================================
 1. fix is_pctext so that it actually catches corrupt spots and announces.
 2. fix console.pl so that you can type in '0' again
index ed714fe82c11b0862ef8d7051b4349e1e66f81d6..6cf35b2bd77e3a398d652ba7d3f2af98f8e77228 100644 (file)
@@ -165,7 +165,7 @@ sub phex
 sub parray
 {
        my $ref = shift;
-       return join(', ', @{$ref});
+       return ref $ref ? join(', ', @{$ref}) : $ref;
 }
 
 # take the arg as an array reference and print as a list of pairs
index 190d0b43c49b4bcaafb8c6d62511af31d30a2270..95c6ac74347793ce9f38f27d8af303bbe1265930 100644 (file)
@@ -44,7 +44,6 @@ sub dequeue
                for (@lines) {
                        if (defined $_) {
                                s/\%([0-9A-F][0-9A-F])/chr(hex($1))/eg;
-                               s/[\x00-\x08\x0a-\x19\x1b-\x1f\x80-\x9f]/./g;         # immutable CSI sequence + control characters
                        } else {
                                $_ = '';
                        }
index eae1c0ff4451a477af22765c3d36cfd3f00bc538..41fc953e4785905e06e1f0e1e490b6260fc03e72 100755 (executable)
@@ -224,6 +224,9 @@ sub addtotop
 {
        while (@_) {
                my $inbuf = shift;
+               if ($inbuf =~ s/\x07+$//) {
+                       beep();
+               }
                push @shistory, $inbuf;
                shift @shistory if @shistory > $maxshist;
        }
@@ -240,6 +243,7 @@ sub rec_socket
        if (defined $msg) {
                my ($sort, $call, $line) = $msg =~ /^(\w)([^\|]+)\|(.*)$/;
                
+               $line =~ s/[\x00-\x06\x08\x0a-\x19\x1b-\x1f\x80-\x9f\xf0-\xff]/./g;         # immutable CSI sequence + control characters
                if ($sort && $sort eq 'D') {
                        $line = " " unless length($line);
                        addtotop($line);
@@ -482,7 +486,7 @@ $SIG{__DIE__} = \&sig_term;
 
 $conn->send_later("A$call|$connsort width=$cols");
 $conn->send_later("I$call|set/page $maxshist");
-$conn->send_later("I$call|set/nobeep");
+#$conn->send_later("I$call|set/nobeep");
 
 #Msg->set_event_handler(\*STDIN, "read" => \&rec_stdin);