Handle other include formats

This commit is contained in:
Jamie Cameron
2020-04-17 09:46:53 -07:00
parent 1758f34318
commit f25de1bc14
2 changed files with 3 additions and 2 deletions

View File

@@ -46,7 +46,7 @@ for(my $lnum=0; $lnum<@$lref; $lnum++) {
$line =~ s/#.*$//g; # Remove hash comment
$line =~ s/\/\/.*$//g if ($line !~ /".*\/\/.*"/);
$line =~ s/\/\*.*\*\///g; # Remove multi-line comment
if ($line =~ /^\@include\s+"(.*)"/) {
if ($line =~ /^\@include\s+"([^"]+)"/) {
# Found an include .. replace with contents of the file(s)
local $incs = $1;
if ($incs !~ /^\//) {

View File

@@ -36,7 +36,8 @@ foreach my $line (@lines) {
last if ($line !~ s/\\$//);
}
}
if ($line =~ /^\$IncludeConfig\s+(\S+)/) {
if ($line =~ /^\$IncludeConfig\s+(\S+)/ ||
$line =~ /^include\(file="([^"]+)"/) {
# rsyslog include statement .. follow the money
foreach my $icfile (glob($1)) {
my $ic = &get_config($icfile);