Allow both {...} and ';' with INLINE

Signed-off-by: Tom Eastep <teastep@shorewall.net>
This commit is contained in:
Tom Eastep 2013-04-11 12:57:59 -07:00
parent b33bdeaa02
commit c34cf333ba

View File

@ -1904,6 +1904,8 @@ sub split_line1( $$;$$ ) {
my @maxcolumns = ( keys %$columnsref );
$maxcolumns = @maxcolumns;
}
$inline_matches = '';
#
# First see if there is a semicolon on the line; what follows will be column/value paris
#
@ -1914,6 +1916,20 @@ sub split_line1( $$;$$ ) {
# Found it -- be sure there wasn't more than one.
#
fatal_error "Only one semicolon (';') allowed on a line" if defined $rest;
if ( $currentline =~ /^\s*INLINE(?:\(.*\))?\s/) {
$inline_matches = $pairs;
if ( $columns =~ /^(\s*|.*[^&@%]){(.*)}\s*$/ ) {
#
# Pairs are enclosed in curly brackets.
#
$columns = $1;
$pairs = $2;
} else {
$pairs = '';
}
}
} elsif ( $currentline =~ /^(\s*|.*[^&@%]){(.*)}$/ ) {
#
# Pairs are enclosed in curly brackets.
@ -1949,15 +1965,10 @@ sub split_line1( $$;$$ ) {
push @line, '-' while @line < $maxcolumns;
$inline_matches = '';
if ( supplied $pairs ) {
$pairs =~ s/^\s*//;
$pairs =~ s/\s*$//;
if ( $first =~ /^INLINE(?:\(.*\))?$/) {
$inline_matches = $pairs;
} else {
my @pairs = split( /,?\s+/, $pairs );
for ( @pairs ) {
@ -1972,7 +1983,6 @@ sub split_line1( $$;$$ ) {
$line[$column] = $value;
}
}
}
@line;
}