Skip to content

Commit

Permalink
Merge pull request #515 from ikedas/issue-468addition by ikedas
Browse files Browse the repository at this point in the history
A scalar parameter in list config without value is warned
  • Loading branch information
ikedas authored Jan 14, 2019
2 parents edda816 + 898f69b commit f6dd8f2
Showing 1 changed file with 11 additions and 14 deletions.
25 changes: 11 additions & 14 deletions src/lib/Sympa/List.pm
Original file line number Diff line number Diff line change
Expand Up @@ -6398,7 +6398,7 @@ sub _load_include_admin_user_file {
}

unless ($paragraph[$i] =~
/^\s*$key\s+($pinfo->{$pname}{'file_format'}{$key}{'file_format'})\s*$/i
/^\s*$key(?:\s+($pinfo->{$pname}{'file_format'}{$key}{'file_format'}))?\s*$/i
) {
chomp($paragraph[$i]);
$log->syslog('info',
Expand All @@ -6421,7 +6421,8 @@ sub _load_include_admin_user_file {
if (defined $pinfo->{$pname}{'file_format'}{$k}{'default'}
) {
$hash{$k} =
$self->_load_list_param($k, 'default',
$self->_load_list_param($k,
$pinfo->{$pname}{'file_format'}{$k}{'default'},
$pinfo->{$pname}{'file_format'}{$k});
}
}
Expand Down Expand Up @@ -6454,7 +6455,7 @@ sub _load_include_admin_user_file {
}

unless ($paragraph[0] =~
/^\s*$pname\s+($pinfo->{$pname}{'file_format'})\s*$/i) {
/^\s*$pname(?:\s+($pinfo->{$pname}{'file_format'}))?\s*$/i) {
chomp($paragraph[0]);
$log->syslog('info', 'Bad entry "%s" in %s',
$paragraph[0], $file);
Expand Down Expand Up @@ -8150,14 +8151,9 @@ sub _load_list_param {
my $robot = $self->{'domain'};
my $directory = $self->{'dir'};

## Empty value
if ($value =~ /^\s*$/) {
return undef;
}

## Default
if ($value eq 'default') {
$value = $p->{'default'};
# Empty value.
unless (defined $value and $value =~ /\S/) {
return undef; #FIXME
}

## Search configuration file
Expand Down Expand Up @@ -8406,7 +8402,7 @@ sub _load_list_config_file {
}

unless ($paragraph[$i] =~
/^\s*$key\s+($pinfo->{$pname}{'file_format'}{$key}{'file_format'})\s*$/i
/^\s*$key(?:\s+($pinfo->{$pname}{'file_format'}{$key}{'file_format'}))?\s*$/i
) {
chomp($paragraph[$i]);
$log->syslog(
Expand Down Expand Up @@ -8434,7 +8430,8 @@ sub _load_list_config_file {
if (defined $pinfo->{$pname}{'file_format'}{$k}{'default'}
) {
$hash{$k} =
$self->_load_list_param($k, 'default',
$self->_load_list_param($k,
$pinfo->{$pname}{'file_format'}{$k}{'default'},
$pinfo->{$pname}{'file_format'}{$k});
}
}
Expand Down Expand Up @@ -8470,7 +8467,7 @@ sub _load_list_config_file {
}

unless ($paragraph[0] =~
/^\s*$pname\s+($pinfo->{$pname}{'file_format'})\s*$/i) {
/^\s*$pname(?:\s+($pinfo->{$pname}{'file_format'}))?\s*$/i) {
chomp($paragraph[0]);
$log->syslog('info', 'Bad entry "%s" in %s',
$paragraph[0], $config_file);
Expand Down

0 comments on commit f6dd8f2

Please sign in to comment.