]> git.sur5r.net Git - bacula/bacula/commitdiff
bweb: return list for output in send_one_cmd()
authorEric Bollengier <eric@eb.homelinux.org>
Mon, 15 Nov 2010 21:57:17 +0000 (22:57 +0100)
committerEric Bollengier <eric@eb.homelinux.org>
Thu, 18 Nov 2010 17:45:56 +0000 (18:45 +0100)
gui/bweb/lib/Bconsole.pm

index 52fb40de6497c15a2df67d3010c4f43c7f1fd8be..3178126039dfcd709dbcede2b287ce2b0d8908e8 100644 (file)
@@ -199,7 +199,7 @@ sub before
 sub send_one_cmd
 {
     my ($self, $line) = @_;
-    my $ret='';
+    my @ret;
     my $cmd = $self->{pref}->{bconsole} ;
     if ($self->{dir}) {
         $cmd = $cmd . " -D '$self->{dir}'";
@@ -214,11 +214,11 @@ sub send_one_cmd
     $l = <$OUT>;                # line
 
     while ($l = <$OUT>) {
-        $ret .= $l;
+        push @ret, $l;
     }
     close($OUT);
     waitpid($pid, 0);
-    return $ret;
+    return wantarray? @ret : \@ret;
 }
 
 sub send_cmd