Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

A scalar parameter in list config without value is warned #515

Merged
merged 2 commits into from
Jan 14, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 11 additions & 14 deletions src/lib/Sympa/List.pm
Original file line number Diff line number Diff line change
Expand Up @@ -6392,7 +6392,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 @@ -6415,7 +6415,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 @@ -6448,7 +6449,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 @@ -8144,14 +8145,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 @@ -8400,7 +8396,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 @@ -8428,7 +8424,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 @@ -8464,7 +8461,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