Fix parsing of funny blocks like sortlist

This commit is contained in:
Jamie Cameron
2009-04-26 05:40:25 +00:00
parent 669394507c
commit b1ce9f9e0a
2 changed files with 9 additions and 1 deletions

View File

@@ -106,3 +106,4 @@ When adding a master zone with automatically created slaves, add an also-notify
---- Changes since 1.480 ----
Added mass record change and creation buttons to the zone search results page.
Made the manual config file editor textboxes full-width.
Fixed a bug that cause blocks like sortlist not be parsed properly, and possible cause Webmin to corrupt other parts of the named.conf file.

View File

@@ -197,8 +197,15 @@ sub parse_struct
{
local (%str, $i, $j, $t, @vals);
$i = ${$_[2]};
$str{'name'} = lc($_[0]->[$i]);
$str{'line'} = $_[1]->[$i];
if ($_[0]->[$i] ne '{') {
# Has a name
$str{'name'} = lc($_[0]->[$i]);
}
else {
# No name, so need to move token pointer back one
$i--;
}
$str{'index'} = $_[3];
$str{'file'} = $_[4];
if ($str{'name'} eq 'inet') {