]> git.proxmox.com Git - dab.git/commitdiff
read installed: do not be greedy when matching package status value
authorThomas Lamprecht <t.lamprecht@proxmox.com>
Fri, 1 Oct 2021 15:20:42 +0000 (17:20 +0200)
committerThomas Lamprecht <t.lamprecht@proxmox.com>
Fri, 1 Oct 2021 15:23:05 +0000 (17:23 +0200)
Else a trailing whitespace is slurped into the $2 value, and that can
trip up users of this data, e.g., getpkgfile

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

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
DAB.pm

diff --git a/DAB.pm b/DAB.pm
index 3c86518d611c63e782cd68f02d5614cc18decc03..6d850beeed9f3c7fb988bf1085d34d476c9bb2d4 100644 (file)
--- a/DAB.pm
+++ b/DAB.pm
@@ -895,7 +895,7 @@ sub read_installed {
        $rec .= "\n";
        my $res = {};
 
-       while ($rec =~ s/^([^:]+):\s+(.*)\s*\n//) {
+       while ($rec =~ s/^([^:]+):\s+(.*?)\s*\n//) {
            $res->{lc $1} = $2;
        }