[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#962601: manpage-section-mismatch doesn't take into account manpages with multiple binaries



On Wednesday, July 08 2020, Felix Lechner wrote:

> On Wed, Jul 8, 2020 at 7:41 PM Sergio Durigan Junior
> <sergiodj@debian.org> wrote:
>>
>> I honestly don't feel like spending
>> too much time investigating Perl's internals
>
> What does it have to do with Perl's internals, please?

Well, according to ParseWords's documentation:

  https://perldoc.perl.org/Text/ParseWords.html

parse_line should take a line ($line, in our case), a delimeter (\s+, in
our case), and split the line into tokens respecting the delimeters.  It
is obviously not working the way it should when there is a backslash in
the middle of the line, which is strange.  I'm not saying there is a bug
in the implementation, but, in this specific scenario, the documentation
doesn't reflect what really happens (that is, the function doesn't
return the expected tokens).

>> What do you think?
>
> Would Text::Balanced help extract the quoted strings, and work from there?

I don't know.  As I said, Perl is not my specialty.  But the problem
here is not just removing the backslash; the real problem is that the
title of the manpage (the first element in the .TH header) contains an
\FB in the beginning, which seems to be wrong (there is no \fR in the
line, and man doesn't render the title in bold, ignoring the \fB).  Not
mentioning the backslash at the end of the title, which (erroneously)
escapes the double quote.

I don't have the time right now to play a bit with Text::Balanced and
see what comes out of it, so if you're not satisfied with the solution I
proposed, my other suggestion would be to revert the original patch (and
reintroduce the bug I fixed with it, of course) until we can figure out
how to tackle this issue.

Cheers,

-- 
Sergio
GPG key ID: 237A 54B1 0287 28BF 00EF  31F4 D0EB 7628 65FC 5E36
Please send encrypted e-mail if possible
https://sergiodj.net/

Attachment: signature.asc
Description: PGP signature


Reply to: