X-Git-Url: http://gb7djk.dxcluster.net/gitweb/gitweb.cgi?a=blobdiff_plain;f=perl%2FIntMsg.pm;h=510a1f9a661ab03162ba9370c68ab5e3f4a56730;hb=70ffd373d199a2a83072da4e2b75572a2270383f;hp=8065f3024e5c693e04e7b50620a5d136e83c2a00;hpb=586cbb347e7639f5575b48572e75140501a109c0;p=spider.git diff --git a/perl/IntMsg.pm b/perl/IntMsg.pm index 8065f302..510a1f9a 100644 --- a/perl/IntMsg.pm +++ b/perl/IntMsg.pm @@ -10,6 +10,13 @@ package IntMsg; use strict; + +use vars qw($VERSION $BRANCH); +$VERSION = sprintf( "%d.%03d", q$Revision$ =~ /(\d+)\.(\d+)/ ); +$BRANCH = sprintf( "%d.%03d", q$Revision$ =~ /\d+\.\d+\.(\d+)\.(\d+)/ ) || 0; +$main::build += $VERSION; +$main::branch += $BRANCH; + use Msg; use vars qw(@ISA); @@ -27,7 +34,7 @@ sub dequeue { my $conn = shift; - if ($conn->{msg} =~ /\n/) { + if ($conn && $conn->{msg} =~ /\n/) { my @lines = split /\r?\n/, $conn->{msg}; if ($conn->{msg} =~ /\n$/) { delete $conn->{msg}; @@ -37,11 +44,11 @@ sub dequeue for (@lines) { if (defined $_) { s/\%([0-9A-F][0-9A-F])/chr(hex($1))/eg; - s/[\x00-\x08\x0a-\x1f\x80-\x9f]/./g; # immutable CSI sequence + control characters + s/[\x00-\x08\x0a-\x19\x1b-\x1f\x80-\x9f]/./g; # immutable CSI sequence + control characters } else { $_ = ''; } - &{$conn->{rproc}}($conn, $_); + &{$conn->{rproc}}($conn, $_) if exists $conn->{rproc}; } } }