} elsif ($conn->{state} eq 'WC') {
if (exists $conn->{cmd} && @{$conn->{cmd}}) {
$conn->_docmd($msg);
- unless (@{$conn->{cmd}}) {
+ unless (exists $conn->{cmd} && @{$conn->{cmd}}) {
$conn->{state} = 'C';
&{$conn->{rproc}}($conn, "O$conn->{call}|telnet");
delete $conn->{cmd};
if ($bytes_read > 0) {
if ($msg =~ /\n/) {
@lines = split /\r?\n/, $msg;
+ $lines[0] = '' unless @lines;
$lines[0] = $conn->{msg} . $lines[0] if exists $conn->{msg};
push @lines, ' ' unless @lines;
if ($msg =~ /\n$/) {