Blame SOURCES/amanda-error-amrecover.patch

7c66a1
diff --git a/server-src/amidxtaped.pl b/server-src/amidxtaped.pl
7c66a1
index 79ea978..5a4106e 100644
7c66a1
--- a/server-src/amidxtaped.pl
7c66a1
+++ b/server-src/amidxtaped.pl
7c66a1
@@ -890,7 +890,8 @@ sub getline {
7c66a1
 	last if $c eq "\n";
7c66a1
     }
7c66a1
 
7c66a1
-    my $chopped = $line;
7c66a1
+    $line =~ /^(.*)$/;
7c66a1
+    my $chopped = $1;
7c66a1
     $chopped =~ s/[\r\n]*$//g;
7c66a1
     debug("CTL << $chopped");
7c66a1
 
7c66a1
@@ -914,8 +915,8 @@ sub getline_async {
7c66a1
 	return $async_read_cb->($err, undef) if $err;
7c66a1
 
7c66a1
 	$buf .= $data;
7c66a1
-	if ($buf =~ /\r\n$/) {
7c66a1
-	    my $chopped = $buf;
7c66a1
+	if ($buf =~ /^(.*\r\n)$/) {
7c66a1
+	    my $chopped = $1;
7c66a1
 	    $chopped =~ s/[\r\n]*$//g;
7c66a1
 	    debug("CTL << $chopped");
7c66a1
 
7c66a1
@@ -951,8 +952,8 @@ sub sendctlline {
7c66a1
     my $self = shift;
7c66a1
     my ($msg, $async_write_cb) = @_;
7c66a1
 
7c66a1
-    my $chopped = $msg;
7c66a1
-    $chopped =~ s/[\r\n]*$//g;
7c66a1
+    $msg =~ /^(.*)$/;
7c66a1
+    my $chopped = $1;
7c66a1
 
7c66a1
     if ($self->{'ctl_stream'}) {
7c66a1
 	debug("CTL >> $chopped");