man ioslave: spurious numbers included in clang(1) man page
AbandonedPublic

Authored by marten on Sep 14 2017, 3:48 PM.

Details

Reviewers
kfm-devel
mkoller
Group Reviewers
Plasma
Summary

Viewing the clang(1) man page shows spurious floating point numbers, either "0.0", "3.5" or "7.0", scattered throughout the page:

These appear to be generated by the ".RS" line within a macro, as in the decompressed clang.1.bz2 man page source:

.de1 INDENT
.\" .rstReportMargin pre:
. RS \\$1
. nr rst2man-indent\\n[rst2man-indent-level] \\n[an-margin]
. nr rst2man-indent-level +1
.\" .rstReportMargin post:
..

where the macro parameter to .INDENT is the spurious floating point number that appears.

When the .RS is seen in the REQ_RS case in scan_request(), if there are arguments scan_expression() is called to read the first argument. Unfortunately, scan_expression() simply sees the "\\$1" text and does not attempt to expand it as a macro argument. Since this string does not match any of the syntax known to scan_expression() the argument is ignored, the scan pointer is not advanced and the argument is output as if it were normal text.

This change recognises the "\\$1" syntax in scan_expression() and uses scan_escape_direct() to parse it. The string value is then converted to a number. It is only possible to return an integer (rounded) because scan_expression() only handles integers, but at least something approximate is returned and the argument is skipped and not output.

Test Plan

Built kio_man with this change, verified correct output of this man page and others.

Diff Detail

Repository
R320 KIO Extras
Lint
Lint Skipped
Unit
Unit Tests Skipped
marten created this revision.Sep 14 2017, 3:48 PM
Restricted Application added a project: Plasma. · View Herald TranscriptSep 14 2017, 3:48 PM
Restricted Application added a subscriber: plasma-devel. · View Herald Transcript
marten added a comment.Jan 8 2018, 1:19 PM

Ping - anyone able to review?

Restricted Application added projects: Dolphin, Frameworks. · View Herald TranscriptMar 1 2019, 10:18 AM
Restricted Application added a subscriber: kde-frameworks-devel. · View Herald Transcript
ltoscano added a subscriber: ltoscano.

Apologize for the long delay - I can't reproduce the issue with the current master. The mentioned structure of the clang man page seems to be the same (clang 8).

Adding @mkoller too.

Confirmed that man:clang(1) now correctly displays the man page with no spurious numbers shown. Would be happy to abandon this review request.

mkoller requested changes to this revision.Jul 18 2019, 11:19 AM

I think this was solved with bugfix to Bug Nr 335169 with commit 87d8ab4371149c84794f4e93d1f590f7bac5f327

you should abandon this patch

This revision now requires changes to proceed.Jul 18 2019, 11:19 AM
marten abandoned this revision.Jul 20 2019, 4:09 PM