diff options
author | Jesse Luehrs <doy@tozt.net> | 2009-07-10 22:23:41 -0500 |
---|---|---|
committer | Jesse Luehrs <doy@tozt.net> | 2009-07-10 22:23:41 -0500 |
commit | 1a0beb84397df498e6e78b25fcfc6b98ff52b282 (patch) | |
tree | 88429feda942c5281496539a967d2d9971149137 | |
parent | 0beaf55609214a2ab33964600d9e5acdadc78d41 (diff) | |
download | app-termcast-1a0beb84397df498e6e78b25fcfc6b98ff52b282.tar.gz app-termcast-1a0beb84397df498e6e78b25fcfc6b98ff52b282.zip |
perl-- # "0" is false/:
-rw-r--r-- | lib/App/Termcast.pm | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/App/Termcast.pm b/lib/App/Termcast.pm index a100e25..0f2dc7e 100644 --- a/lib/App/Termcast.pm +++ b/lib/App/Termcast.pm @@ -71,7 +71,7 @@ sub run { if (vec($rout, fileno(STDIN), 1)) { my $buf; sysread STDIN, $buf, 4096; - if (!$buf) { + if (!defined $buf || length $buf == 0) { warn "Error reading from stdin: $!" unless defined $buf; last; } @@ -79,7 +79,7 @@ sub run { } if (vec($rout, $ptyfd, 1)) { my $buf = $pty->read(0); - if (!$buf) { + if (!defined $buf || length $buf == 0) { warn "Error reading from pty: $!" unless defined $buf; last; } |