bugGNU troff - Bugs: bug #61408, [man] empty \*[an-extra1] provokes...

 
 

bug #61408: [man] empty \*[an-extra1] provokes warnings

Submitted by:  Bjarni Ingi Gislason <bjarniig>
Submitted on:  Mon 01 Nov 2021 01:49:42 AM UTC
 
Category:  Macro man Severity:  3 - Normal
Item Group:  Warning/Suspicious behaviour Status:  Fixed
Privacy:  Public Assigned to:  gbranden
Open/Closed:  Closed Planned Release:  1.23.0
* Mandatory Fields

Add a New Comment (Rich Markup)
   

Comment Type & Canned Response:
       No canned response available

 

Sat 06 Nov 2021 05:45:39 AM UTC, comment #2: 

commit 34c5fed1be8e4590b67ea9d243ad16ec73ab61b2
Author: G. Branden Robinson <g.branden.robinson@gmail.com>
Date:   Tue Nov 2 21:35:40 2021 +1100

    [man]: Fix Savannah #61408.

    * tmac/an.tmac (an-prepare-inner-footer): Don't try to get a substring
      of an empty string; the man page author might not have specified a
      third argument to `TH` (or supplied an empty one).

    Fixes <https://savannah.gnu.org/bugs/?61408>.  Thanks to Bjarni Ingi
    Gislason for the report.

G. Branden Robinson <gbranden>
Project Administrator
Tue 02 Nov 2021 10:21:59 AM UTC, comment #1: 

original submission:

> [man] Warning about an empty \*[an-extra1]
>
>   "man patch" causes warnings:
>
> troff: backtrace: '/home/bg/git/groff/build/s-tmac/an.tmac':273: macro 'an-prepare-inner-footer'
> troff: backtrace: '/home/bg/git/groff/build/s-tmac/an.tmac':350: macro 'an-footer'
> troff: backtrace: '/home/bg/git/groff/build/s-tmac/an.tmac':61: trap-called macro 'an-end'
> troff: warning: start (0) and end (0) index of substring out of range
>
>   This is caused by the line
>
> .TH PATCH 1 "" GNU
>
>
> line 61 corresponds to line an-footer
> line 273      -"-            substring an-half-cfoot 0 \\n[an-half-cfoot-length]
> line 350      -"-            an-prepare-inner-footer
>


Thanks, Bjarni.  I can confirm.

My diagnostic output is a little different (leaving aside file system differences); this is further evidence that your Git branch is somewhat different from mine.

Try this command.

git diff origin/master master

You might want to follow-up to the groff@ list to get advice on how to move your personal branch to something that makes it easier for you to test the Savannah master branch in parallel with your own.

I also note that with the CHECKSTYLE register set to a true value, the user gets warned about the cause of the problem, but this is not documented and even if it were I have little hope that most man page writers would use it.  :-/

$ echo '.TH patch 1 "" GNU' | tgu -man -rCHECKSTYLE=1
an.tmac:<standard input>:1: style: .TH missing third argument; suggest document modification date in ISO 8601 format (YYYY-MM-DD)
troff: backtrace: '.../groff/build/../tmac/an.tmac':403: macro 'an-prepare-inner-footer'
troff: backtrace: '.../groff/build/../tmac/an.tmac':493: macro 'an-footer'
troff: backtrace: '.../groff/build/../tmac/an.tmac':111: trap-called macro 'an-end'
troff: warning: start and end index of substring out of range

I did indeed assume a nonempty `an-extra1` string.  I will fix that.

I find myself tempted to give it a fallback value.

.ds extra1 "Holocene epoch\" :-|

G. Branden Robinson <gbranden>
Project Administrator
Mon 01 Nov 2021 01:49:42 AM UTC, original submission:  

[man] Warning about an empty \*[an-extra1]

  "man patch" causes warnings:

troff: backtrace: '/home/bg/git/groff/build/s-tmac/an.tmac':273: macro 'an-prepare-inner-footer'
troff: backtrace: '/home/bg/git/groff/build/s-tmac/an.tmac':350: macro 'an-footer'
troff: backtrace: '/home/bg/git/groff/build/s-tmac/an.tmac':61: trap-called macro 'an-end'
troff: warning: start (0) and end (0) index of substring out of range

  This is caused by the line

.TH PATCH 1 "" GNU

line 61 corresponds to line an-footer
line 273      -"-            substring an-half-cfoot 0 \\n[an-half-cfoot-length]
line 350      -"-            an-prepare-inner-footer

Bjarni Ingi Gislason <bjarniig>

 

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

Attach Files:
   
   
Comment:
   

No files currently attached

 

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 bjarniig (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 7 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2021-11-06 gbranden Planned ReleaseNone => 1.23.0
    2021-11-06 gbranden StatusIn Progress => Fixed
        Open/ClosedOpen => Closed
    2021-11-02 gbranden StatusConfirmed => In Progress
    2021-11-02 gbranden StatusNone => Confirmed
        Assigned toNone => gbranden
        Summary[man] Warning about an empty \*[an-extra1] => [man] empty \*[an-extra1] provokes warnings

    Back to the top


    Powered by Savane 3.9