X-Git-Url: http://git.rot13.org/?p=safeq;a=blobdiff_plain;f=terminal-emulator.pl;h=9a91ede0ca9f0a59a18554c0d4c0d8c8b418bc3f;hp=e4ee9a1922e0e6ec9f3dda62d027c7214a8a5383;hb=27f469f2c45c880c8548807b621ffdc9ec5cd6cc;hpb=8526ed608692528375db43b2f963e566af498c24 diff --git a/terminal-emulator.pl b/terminal-emulator.pl index e4ee9a1..9a91ede 100755 --- a/terminal-emulator.pl +++ b/terminal-emulator.pl @@ -39,15 +39,6 @@ my @send_receive = grep { /^.+$/ } split(/\n/, q{ .NOP .NOP -.NOP -.NOP - -.NOP -.NOP - -.NOP -.NOP - .END }); @@ -62,7 +53,7 @@ while ( @send_receive ) { $got =~ s/[\r\n]+$//; warn "# send/expect/got ",dump($send,$expect,$got); warn "<< $got\n"; - if ( $expect ne substr($got,0,length($expect)) ) { + if ( defined $got && defined $expect && $expect ne substr($got,0,length($expect)) ) { warn "ERROR expected [$expect] got [$got]\n"; print "Response>"; my $r = ; chomp $r;