Blame SOURCES/amanda-error-amrecover.patch

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