diff options
author | Graham Barr <gbarr@pobox.com> | 2000-01-17 14:24:11 +0000 |
---|---|---|
committer | Graham Barr <gbarr@pobox.com> | 2000-01-17 14:24:11 +0000 |
commit | 3dd5b5facc0757628b5c8f7131eed5e9029dd56f (patch) | |
tree | 7059857d6d5757a4e881ca400d5018b1f21ccb04 | |
parent | 4a2765c0b294a598f2f0d3c84682a58c3e79d3fe (diff) | |
download | perl-libnet-3dd5b5facc0757628b5c8f7131eed5e9029dd56f.tar.gz |
Net::Cmd
- fix getline not to drop blank lines
-rw-r--r-- | Net/Cmd.pm | 8 |
1 files changed, 3 insertions, 5 deletions
@@ -13,7 +13,7 @@ use strict; use vars qw(@ISA @EXPORT $VERSION); use Carp; -$VERSION = "2.16"; +$VERSION = "2.17"; @ISA = qw(Exporter); @EXPORT = qw(CMD_INFO CMD_OK CMD_MORE CMD_REJECT CMD_ERROR CMD_PENDING); @@ -239,15 +239,13 @@ sub getline substr($buf,0,0) = $partial; ## prepend from last sysread - my @buf = split(/\015?\012/, $buf); ## break into lines + my @buf = split(/\015?\012/, $buf, -1); ## break into lines $partial = length($buf) == 0 || substr($buf, -1, 1) eq "\012" ? '' : pop(@buf); - map { $_ .= "\n" } @buf; - - push(@{${*$cmd}{'net_cmd_lines'}},@buf); + push(@{${*$cmd}{'net_cmd_lines'}}, map { "$_\n" } @buf); } else |