]> git.proxmox.com Git - dab.git/commitdiff
read_packages: do not be greedy when matching package status value
authorFabian Grünbichler <f.gruenbichler@proxmox.com>
Tue, 14 Jun 2022 07:05:47 +0000 (09:05 +0200)
committerFabian Grünbichler <f.gruenbichler@proxmox.com>
Tue, 14 Jun 2022 07:06:42 +0000 (09:06 +0200)
Else a trailing whitespace is slurped into the $2 value, and that can
trip up users of this data.

Reported in the community forum:
https://forum.proxmox.com/threads/dab-internal-error-at-usr-share-perl5-pve-dab-pm-line-1327.97258/

Commit message copied from previous fix for other RE.

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
DAB.pm

diff --git a/DAB.pm b/DAB.pm
index e96008e101bdadac8d2dc27f3a34e7c4000bdea7..3890c0589eaff5e11934e347c5e018db262f9ebd 100644 (file)
--- a/DAB.pm
+++ b/DAB.pm
@@ -1126,7 +1126,7 @@ sub __parse_packages {
 
        my $res = {};
 
-       while ($rec =~ s/^([^:]+):\s+(.*)\s*\n//) {
+       while ($rec =~ s/^([^:]+):\s+(.*?)\s*\n//) {
            $res->{lc $1} = $2;
        }