From 9864508d5692d6f4c5e1d358281eb4842c23f77b Mon Sep 17 00:00:00 2001 From: jluehrs2 Date: Thu, 16 Aug 2007 21:23:11 -0500 Subject: we don't need to explicitly specify a max for writing, since we can use the string length --- lib/IO/Pty/Easy.pm | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/lib/IO/Pty/Easy.pm b/lib/IO/Pty/Easy.pm index cea796b..f6049c2 100644 --- a/lib/IO/Pty/Easy.pm +++ b/lib/IO/Pty/Easy.pm @@ -74,7 +74,6 @@ sub new { # options handle_pty_size => 1, def_max_read_chars => 8192, - def_max_write_chars => 8192, @_, # state @@ -218,15 +217,14 @@ Returns undef on timeout, 0 on failure to write (including if no subprocess is r sub write { my $self = shift; return 0 unless $self->is_active; - my ($text, $timeout, $max_chars) = @_; - $max_chars ||= $self->{def_max_write_chars}; + my ($text, $timeout) = @_; my $win = ''; vec($win, fileno($self->{pty}), 1) = 1; my $nfound = select(undef, $win, undef, $timeout); my $nchars; if ($nfound > 0) { - $nchars = syswrite($self->{pty}, $text, $max_chars); + $nchars = syswrite($self->{pty}, $text, length $text); } return $nchars; } -- cgit v1.2.3-54-g00ecf