X-Git-Url: https://git.proxmox.com/?p=pve-common.git;a=blobdiff_plain;f=src%2FPVE%2FJSONSchema.pm;h=d9d254af6e886df4168eed6113c28e1d63d4d8c3;hp=36a2de994e35cf1c7f8f4655a4f13c0334e6f5fc;hb=3c4d612a70d9521345a54f520f183c8551ff3ad4;hpb=8998d715de6bf45cc456a208130e03228c0a4549 diff --git a/src/PVE/JSONSchema.pm b/src/PVE/JSONSchema.pm index 36a2de9..d9d254a 100644 --- a/src/PVE/JSONSchema.pm +++ b/src/PVE/JSONSchema.pm @@ -1150,13 +1150,12 @@ sub parse_config { my $cfg = {}; - while ($raw && $raw =~ s/^(.*?)(\n|$)//) { + while ($raw =~ /^\s*(.+?)\s*$/gm) { my $line = $1; - - next if $line =~ m/^\#/; # skip comment lines - next if $line =~ m/^\s*$/; # skip empty lines - if ($line =~ m/^(\S+):\s*(\S+)\s*$/) { + next if $line =~ /^#/; + + if ($line =~ m/^(\S+?):\s*(.*)$/) { my $key = $1; my $value = $2; if ($schema->{properties}->{$key} &&