X-Git-Url: https://git.proxmox.com/?p=pve-common.git;a=blobdiff_plain;f=src%2FPVE%2FTools.pm;h=f9270d9b10340eec789346e81f4a926772ccabfd;hp=d9c69e3d803683460ac7b7c95981e3d9d1e8e306;hb=ba104d67600cd96beb14097551d3bc2fe50da580;hpb=cb9db10c1a9855cf40ff13e81f9dd97d6a9b2698 diff --git a/src/PVE/Tools.pm b/src/PVE/Tools.pm index d9c69e3..f9270d9 100644 --- a/src/PVE/Tools.pm +++ b/src/PVE/Tools.pm @@ -497,7 +497,7 @@ sub run_command { if ($h eq $reader) { if ($outfunc || $logfunc) { eval { - while ($buf =~ s/^([^\010\r\n]*)(\r|\n|(\010)+|\r\n)//) { + while ($buf =~ s/^([^\010\r\n]*)(?:\n|(?:\010)+|\r\n?)//) { my $line = $outlog . $1; $outlog = ''; &$outfunc($line) if $outfunc; @@ -518,7 +518,7 @@ sub run_command { } elsif ($h eq $error) { if ($errfunc || $logfunc) { eval { - while ($buf =~ s/^([^\010\r\n]*)(\r|\n|(\010)+|\r\n)//s) { + while ($buf =~ s/^([^\010\r\n]*)(?:\n|(?:\010)+|\r\n?)//) { my $line = $errlog . $1; $errlog = ''; &$errfunc($line) if $errfunc;