mirror of
https://gitlab.com/shorewall/code.git
synced 2024-11-15 12:14:32 +01:00
Fix the level merge code
git-svn-id: https://shorewall.svn.sourceforge.net/svnroot/shorewall/trunk@5467 fbd18981-670d-0410-9b5c-8dc0c1a9a2bb
This commit is contained in:
parent
70a60971dc
commit
018cff4896
@ -1082,20 +1082,21 @@ sub merge_levels ($$) {
|
||||
|
||||
my $subparts = @subparts;
|
||||
|
||||
push @subparts, '' while @subparts < 3; #Avoid undefined values
|
||||
my $target = $subparts[0];
|
||||
|
||||
if ( @supparts == 3 ) {
|
||||
my $level = $supparts[1];
|
||||
return "$subparts[0]:none!:$supparts[2]" if $level eq 'none!';
|
||||
return "$subparts[0]:$supparts[1]:$supparts[2]" if $level =~ /!$/;
|
||||
return $subordinate if $subparts >= 2;
|
||||
return "$subparts[0]:$supparts[1]";
|
||||
push @subparts, '' while @subparts < 3; #Avoid undefined values
|
||||
my $level = $supparts[1];
|
||||
|
||||
if ( $subparts == 3 ) {
|
||||
return "$target:none!:$supparts[2]" if $level eq 'none!';
|
||||
return "$target:$level:$supparts[2]" if $level =~ /!$/;
|
||||
return $subordinate if $subparts >= 2;
|
||||
return "$target:$level";
|
||||
}
|
||||
|
||||
if ( @subparts == 2 ) {
|
||||
my $level = $supparts[1];
|
||||
return "$subparts[0]:none!" if $level eq 'none!';
|
||||
return "$subparts[0]:$supparts[1]" if ($level =~ /!$/) || ($subparts < 2);
|
||||
if ( $subparts == 2 ) {
|
||||
return "$target:none!" if $level eq 'none!';
|
||||
return "$target:$level" if ($level =~ /!$/) || ($subparts < 2);
|
||||
}
|
||||
|
||||
$subordinate;
|
||||
|
Loading…
Reference in New Issue
Block a user