Blame SOURCES/amanda-error-amrecover.patch

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