mirror of
https://git.proxmox.com/git/pve-common
synced 2025-08-15 13:40:00 +00:00
run command: fix matching \r\n and use non-capturing group for it
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
This commit is contained in:
parent
cb9db10c1a
commit
ba104d6760
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user