bugGNU roff - Bugs: bug #55004, Makefile variables expanded in man...

 
 

bug #55004: Makefile variables expanded in man page text are not properly escaped

Submitter:  G. Branden Robinson <gbranden>
Submitted:  Sat 10 Nov 2018 02:07:32 PM UTC
   
 
Category:  General Severity:  2 - Minor
Item Group:  Documentation Status:  Fixed
Privacy:  Public Assigned to:  gbranden
Open/Closed:  Closed Planned Release:  1.22.4
* Mandatory Fields

Add a New Comment Rich Markup
   

Wed 15 Jun 2022 05:29:28 PM UTC, comment #3: 


commit f61089db04816e30cc9045988a4c80f84d0350d7
Author: G. Branden Robinson <g.branden.robinson@gmail.com>
Date:   Sat Nov 10 10:00:01 2018 -0500

    man pages: Escape interpolated Make variables.

            * makevarescape.sed: Transform - to \-, ~ to \(ti, and so forth,
            (with an extra layer of backslashes--see below) so that Makefile
            variables containing ASCII characters that do not represent
            themselves literally in *roff (see groff_char(7)) are correctly
            interpolated into man page text.

            * Makefile.am (.man): Transform Makefile variables with the
            above script when interpolating them into man page text.

            Note that while the script, combined with this target, will
            transform ` to \(ga, including grave accents in Makefile
            variables is likely to fail when the shell lexes the argument to
            echo within the old-style command substitution ``.  Testing
            shows that grave accents should work[1] if POSIX-style command
            substitution $() is done instead.  However, $() is less
            portable.  (Triple-escaping grave accents \\\` inside the
            interpolated Makefile variable will work, but is not attempted
            at present.)

            Note also that the amount of backslash-escaping in the sed
            script is excessive (and incorrect) for normal purposes, but
            required here because a command substitution is being nested
            inside yet another invocation of sed.

            [1] For this target; no assurances about the good behavior of
            unusual characters in Makefile variables in other aspects of the
            groff build are offered.

            Fixes <https://savannah.gnu.org/bugs/index.php?55004>.


G. Branden Robinson <gbranden>
Group administrator
Sat 10 Nov 2018 03:06:52 PM UTC, comment #2: 

Fixed in f61089db04816e30cc9045988a4c80f84d0350d7.

G. Branden Robinson <gbranden>
Group administrator
Sat 10 Nov 2018 02:10:53 PM UTC, comment #1: 

Attaching before-and-after diff of generated man pages.

Note that many pages do not include affected file names, so you may need to scroll down the diff to see the impact (apart from the groff git-version bump).

(file #45398)

G. Branden Robinson <gbranden>
Group administrator
Sat 10 Nov 2018 02:07:32 PM UTC, original submission:  

Makefile variables can contain characters that need to be escaped when interpolated in man page text.  The most notable case is that of hyphen-minus characters in file specifications.

For instance, ".../site-tmac/..." needs to be ".../site\-tmac/..." in man page text.

I have a patch for this.

G. Branden Robinson <gbranden>
Group administrator

 

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

Attach Files:
   
   
Comment:
   

Attached Files
file #45398:  55004.diff added by gbranden (29KiB - 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 (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 5 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2022-06-15 gbranden CategoryNone General
    2018-11-10 gbranden StatusIn Progress Fixed
        Open/ClosedOpen Closed
        Planned ReleaseNone 1.22.4
    2018-11-10 gbranden Attached File- Added 55004.diff, #45398

    Back to the top

    Powered by Savane 3.13-758e.
    Corresponding source code