Correct parsing of previous record

This commit is contained in:
Jamie Cameron
2008-04-04 00:35:45 +00:00
parent c54808323f
commit 3aa2f81cf5
3 changed files with 10 additions and 3 deletions

View File

@@ -69,3 +69,5 @@ BIND on Windows can now be configured using this module.
Mass record creation can now add records for the domain name (by entering @ as the name), as records that already exist.
---- Changes since 1.400 ----
Keys in ACL sections are no long mangled by Webmin. This means that each IP or key must be entered on a separate line in the Access Control Lists page.
---- Changes since 1.410 ----
Corrected parsing of records in zone files with no names, which inherit from the previous record.

View File

@@ -43,9 +43,9 @@ if ($zone->{'file'}) {
if ($config{'show_list'}) {
# display as list
$mid = int((@rcodes+1)/2);
print "<table width=100%> <tr><td width=50%>\n";
print "<table width=100%> <tr><td width=50% valign=top>\n";
&types_table(@rcodes[0..$mid-1]);
print "</td><td width=50%>\n";
print "</td><td width=50% valign=top>\n";
&types_table(@rcodes[$mid..$#rcodes]);
print "</td></tr> </table>\n";
}

View File

@@ -207,7 +207,12 @@ while($i < @tok) {
$i++;
}
if ($dir{'name'} eq '') {
local $prv = $#rv >= 0 ? $rv[$#rv] : $_[2];
# Name comes from previous record
for(my $p=$#rv; $p>=0; $p--) {
$prv = $rv[$p];
last if ($prv->{'name'});
}
$prv ||= $_[2];
$prv || &error(&text('efirst', $lnum[$i]+1, $file));
$dir{'name'} = $prv->{'name'};
$dir{'realname'} = $prv->{'realname'};