mirror of
https://git.proxmox.com/git/pve-common
synced 2025-08-15 19:14:59 +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 ($h eq $reader) {
|
||||||
if ($outfunc || $logfunc) {
|
if ($outfunc || $logfunc) {
|
||||||
eval {
|
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;
|
my $line = $outlog . $1;
|
||||||
$outlog = '';
|
$outlog = '';
|
||||||
&$outfunc($line) if $outfunc;
|
&$outfunc($line) if $outfunc;
|
||||||
@ -518,7 +518,7 @@ sub run_command {
|
|||||||
} elsif ($h eq $error) {
|
} elsif ($h eq $error) {
|
||||||
if ($errfunc || $logfunc) {
|
if ($errfunc || $logfunc) {
|
||||||
eval {
|
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;
|
my $line = $errlog . $1;
|
||||||
$errlog = '';
|
$errlog = '';
|
||||||
&$errfunc($line) if $errfunc;
|
&$errfunc($line) if $errfunc;
|
||||||
|
Loading…
Reference in New Issue
Block a user