From 44d5e9db7d6bcd5f05218950e110ba79967244d2 Mon Sep 17 00:00:00 2001 From: jluehrs2 Date: Wed, 21 May 2008 02:54:42 -0500 Subject: ReadKey fails on undef, not false --- bin/te | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/bin/te b/bin/te index aca502d..0e3afcd 100644 --- a/bin/te +++ b/bin/te @@ -22,7 +22,10 @@ sub command_as_string { my $command = ''; COMMAND: while (1) { print '*'; - KEY: while (my $c = ReadKey 0) { + KEY: while (1) { + my $c = ReadKey 0; + last KEY unless defined $c; + my $pc = substr($command, -1); if ($c eq "\e") { print '$'; -- cgit v1.2.3-54-g00ecf