Skip to content
Snippets Groups Projects
Commit 7ed1a171 authored by Mark Harrison's avatar Mark Harrison
Browse files

Support line continuations (refs #10)

git-svn-id: https://labs.omniti.com/resmon/branches/resmon2@382 8c0face9-b7db-6ec6-c4b3-d5f7145c7d55
parent 61a84e79
No related branches found
No related tags found
No related merge requests found
......@@ -22,10 +22,24 @@ sub new {
my $current;
my $line = 0;
my $oldline = '';
while(<$conf>) {
chomp;
$line++;
next if /^\s*#/;
next if /^\s*$/;
# Line continuation
if ($oldline) {
$_ = $oldline . $_;
$oldline = '';
}
if (/\\$/) {
$_ =~ s/\\$//;
$oldline = $_;
next;
}
if($current) {
if(/^\s*([^:\s](?:[^:]*[^:\s])?)\s*:\s*(.+)\s*$/) {
next if $current eq "BAD_MODULE";
......@@ -54,7 +68,7 @@ sub new {
} elsif (/^\s*\}\s*$/) {
$current = undef;
} else {
die "Syntax Error on line $line\n";
die "Syntax Error in config file $filename on line $line\n";
}
} else {
if(/\s*(\S+)\s*\{/) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment