mirror of
https://github.com/webmin/webmin.git
synced 2025-07-21 23:40:34 +00:00
Support multi-line mappings https://github.com/webmin/webmin/issues/2279
This commit is contained in:
@ -814,6 +814,7 @@ sub get_maps
|
||||
&open_readfile(MAPS, $maps_file);
|
||||
my $i = 0;
|
||||
my $cmt;
|
||||
my $lastmap;
|
||||
while (<MAPS>)
|
||||
{
|
||||
s/\r|\n//g; # remove newlines
|
||||
@ -821,8 +822,8 @@ sub get_maps
|
||||
# A comment line
|
||||
$cmt = &is_table_comment($_);
|
||||
}
|
||||
elsif (/^\s*(\/[^\/]*\/[a-z]*)\s+(.*)/ ||
|
||||
/^\s*([^\s]+)\s+(.*)/) {
|
||||
elsif (/^(\/[^\/]*\/[a-z]*)\s+(.*)/ ||
|
||||
/^([^\s]+)\s+(.*)/) {
|
||||
# An actual map
|
||||
$number++;
|
||||
my %map;
|
||||
@ -837,6 +838,12 @@ sub get_maps
|
||||
$map{'cmt'} = $cmt;
|
||||
push(@{$maps_cache{$_[0]}}, \%map);
|
||||
$cmt = undef;
|
||||
$lastmap = \%map;
|
||||
}
|
||||
elsif (/^\s+(\S.*$)/ && $lastmap) {
|
||||
# Continuation line
|
||||
$lastmap->{'value'} .= " ".$1;
|
||||
$lastmap->{'eline'} = $i;
|
||||
}
|
||||
else {
|
||||
$cmt = undef;
|
||||
|
Reference in New Issue
Block a user