Bug#1005049: lintian: incorrect leading comma in "sub oxford_enumeration"
Package: lintian
Version: 2.114.0
Severity: minor
Hi,
I see output like this:
N: Please refer to , Debian Developer's Reference section 3.1.4, Debian
N: Policy Manual section 4.3, and Bug#755153 for details.
^^^
The code in question is as follows:
sub oxford_enumeration {
my ($self, $conjunctive, @alternatives) = @_;
return $EMPTY
unless @alternatives;
# remove and save last element
my $final = pop @alternatives;
my $maybe_comma = (@alternatives > 1 ? $COMMA : $EMPTY);
my $text = $EMPTY;
$text = join($COMMA . $SPACE, @alternatives) . "$maybe_comma $conjunctive "
if @alternatives;
$text .= $final;
return $text;
}
I don't think the "join($COMMA . $SPACE, @alternatives)" is right,
otherwise the first item in the list starts with a comma, as we can
see in the output quoted above.
(I would change it directly, but I can't immediately grok what is going
on with $maybe_comma, etc. so I don't want to break anything.)
Regards,
--
,''`.
: :' : Chris Lamb
`. `'` lamby@debian.org / chris-lamb.co.uk
`-
Reply to: