[pve-devel] [PATCH common] Fix 2339: Handle multiple blank lines correctly
Fabian Ebner
f.ebner at proxmox.com
Tue Aug 27 09:01:11 CEST 2019
Otherwise two blank lines between sections cause the loop to end prematurely.
Signed-off-by: Fabian Ebner <f.ebner at proxmox.com>
---
src/PVE/SectionConfig.pm | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/src/PVE/SectionConfig.pm b/src/PVE/SectionConfig.pm
index dcecce6..1bb285f 100644
--- a/src/PVE/SectionConfig.pm
+++ b/src/PVE/SectionConfig.pm
@@ -308,7 +308,10 @@ sub parse_config {
}
};
- while (my $line = &$nextline()) {
+ while (@lines) {
+ my $line = &$nextline();
+ next unless $line;
+
my $errprefix = "file $filename line $lineno";
my ($type, $sectionId, $errmsg, $config) = $class->parse_section_header($line);
--
2.20.1
More information about the pve-devel
mailing list