X-Git-Url: http://git.rot13.org/?p=safeq;a=blobdiff_plain;f=terminal-emulator.pl;h=9a91ede0ca9f0a59a18554c0d4c0d8c8b418bc3f;hp=781d3538f54c4760bd12fdb188ca6f5290690aad;hb=27f469f2c45c880c8548807b621ffdc9ec5cd6cc;hpb=4262030d6d2559c6ce7d1e4e6edf1e6828acd4ee diff --git a/terminal-emulator.pl b/terminal-emulator.pl index 781d353..9a91ede 100755 --- a/terminal-emulator.pl +++ b/terminal-emulator.pl @@ -31,16 +31,7 @@ my @send_receive = grep { /^.+$/ } split(/\n/, q{ .CARD OK Ime Prezime (nobody@example.com) .ACTION -.ACTION CMENUS0 - -.NOP -.NOP - -.NOP -.NOP - -.NOP -.NOP +.ACTION CMENUS .NOP .NOP @@ -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 $got ) { + 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;