bugGNU roff - Bugs: bug #50771, mdoc(7) .Lk intends to handle...

 
 

bug #50771: mdoc(7) .Lk intends to handle punctuation, but fails to do so

Submitter:  Ingo Schwarze <schwarze>
Submitted:  Sun 09 Apr 2017 11:04:54 PM UTC
   
 
Category:  Macro mdoc Severity:  3 - Normal
Item Group:  Incorrect behaviour Status:  Fixed
Privacy:  Public Assigned to:  schwarze
Open/Closed:  Closed Planned Release:  1.22.4
* Mandatory Fields

Add a New Comment Rich Markup
   

Wed 15 Jun 2022 06:28:52 PM UTC, comment #2: 


commit 2464569cae9e21a7bff31fa78b563f2502bec94f
Author: Ingo Schwarze <schwarze@usta.de>
Date:   Mon Apr 10 22:41:24 2017 +0200

    tmac/doc.tmac-u: Punctuation handling of .Lk fixed

    The implementation of the groff_mdoc(7) .Lk (hyperlink) macro
    contains code to make sure that the second argument is not
    punctuation before treating it as a link text, but the test
    can never lead to the result "punctuation" because the
    initialization of the global variable doc-width was missing
    before the call to doc-get-arg-type.  Consequently, even "."
    was not recognized as punctuation.


G. Branden Robinson <gbranden>
Group administrator
Mon 10 Apr 2017 07:53:44 AM UTC, comment #1: 

Confirmed, I'll commit it soon. Thank you for reporting and fixing it.

Carsten Kunze <carstenkunze>
Group Member
Sun 09 Apr 2017 11:04:54 PM UTC, original submission:  

The implementation of the groff_mdoc(7) .Lk (hyperlink) macro contains code to make sure that the second argument is not punctuation before treating it as a link text, but the test can never lead to the result "punctuation" because the initialization of the global variable doc-width is missing before the call to doc-get-arg-type.  Consequently, even "." is not recognized as punctuation:

  $ nroff -mdoc
 .Lk https://www.example.com/ .

results in:

 .: https://www.example.com/

while the correct result would be:

 https://www.example.com/.

Simple bugfix patch attached.

Problem reported by Anthony Bentley, bentley at openbsd dot org, fix by me.

Ingo Schwarze <schwarze>
Group Member

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach Files:
   
   
Comment:
   

Attached Files
file #40340:  Lk-punct.patch added by schwarze (474B - text/x-patch)

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by gbranden (Posted a comment)
  • -email is unavailable- added by carstenkunze (Posted a comment)
  • -email is unavailable- added by schwarze (Submitted the item)
  •  

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

    Only logged-in users can vote.

     

    Follow 9 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2022-06-15 gbranden CategoryNone Macro mdoc
        Assigned tocarstenkunze schwarze
    2017-04-15 carstenkunze StatusReady for Merge Fixed
        Open/ClosedOpen Closed
        Planned ReleaseNone 1.22.4
    2017-04-10 carstenkunze StatusConfirmed Ready for Merge
    2017-04-10 carstenkunze StatusNone Confirmed
        Assigned toNone carstenkunze
    2017-04-09 schwarze Attached File- Added Lk-punct.patch, #40340

    Back to the top

    Powered by Savane 3.13-758e.
    Corresponding source code