about summary refs log tree commit
path: root/Net/FTP/A.pm
diff options
context:
space:
mode:
Diffstat (limited to 'Net/FTP/A.pm')
-rw-r--r--Net/FTP/A.pm6
1 files changed, 3 insertions, 3 deletions
diff --git a/Net/FTP/A.pm b/Net/FTP/A.pm
index 427d02b..c117d69 100644
--- a/Net/FTP/A.pm
+++ b/Net/FTP/A.pm
@@ -10,7 +10,7 @@ use Carp;
 require Net::FTP::dataconn;
 
 @ISA     = qw(Net::FTP::dataconn);
-$VERSION = "1.18";
+$VERSION = "1.19";
 
 
 sub read {
@@ -77,8 +77,8 @@ sub write {
   my $timeout = @_ ? shift: $data->timeout;
 
   my $nr = (my $tmp = substr($buf, 0, $size)) =~ tr/\r\n/\015\012/;
-  $tmp =~ s/([^\015])\012/$1\015\012/sg if $nr;
-  $tmp =~ s/^\012/\015\012/ unless ${*$data}{'net_ftp_outcr'};
+  $tmp =~ s/(?<!\015)\012/\015\012/sg if $nr;
+  $tmp =~ s/^\015// if ${*$data}{'net_ftp_outcr'};
   ${*$data}{'net_ftp_outcr'} = substr($tmp, -1) eq "\015";
 
   # If the remote server has closed the connection we will be signal'd