bugGNU roff - Bugs: bug #61116, [troff] clamp output line length...

 
 

bug #61116: [troff] clamp output line length to horizontal resolution

Submitter:  G. Branden Robinson <gbranden>
Submitted:  Sat 04 Sep 2021 04:52:15 PM UTC
   
 
Category:  Core Severity:  3 - Normal
Item Group:  Incorrect behaviour Status:  Fixed
Privacy:  Public Assigned to:  gbranden
Open/Closed:  Closed Planned Release:  1.23.0
* Mandatory Fields

Add a New Comment Rich Markup
   

Tue 07 Sep 2021 08:22:38 AM UTC, comment #1: 

I forgot to add a proper bug-closer to the ChangeLog entry for this ticket; I'll fix that.  It will look like this.


2021-09-06  G. Branden Robinson <g.branden.robinson@gmail.com>

        [troff]: Clamp line and title lengths to device horizontal
        resolution.

        * src/roff/troff/env.cpp (line_length, title_length): Do it.

        Fixes <https://savannah.gnu.org/bugs/?61116>.


In the meantime, the input behaves as John Gardner requested.


$ ./build/test-groff -Tutf8 EXPERIMENTS/61089.roff | cat -s
line length in diversion is 24
troff: EXPERIMENTS/61089.roff:11: warning [p 0, 0.0i, div 'A', 0.0i]: line has non-positive width 0m
line length is 24
troff: warning [p 1, 0.0i]: can't break line
XYZ


G. Branden Robinson <gbranden>
Group administrator
Sat 04 Sep 2021 04:52:15 PM UTC, original submission:  

This issue arose during analysis of bug #61089.

Observe the following Heirloom Doctools troff behavior.


$ cat ll.roff
.tm horizontal resolution .H is \n(.Hu
.nr ll 49u
.de m1
.       ll \\n(llu
.       tm ll: \\n(llu; .l: \\n(.lu
.       nr ll -1
.       if \\n(llu>=0 .m1
..
.m1
$ ./bin/nroff ./ll.roff
horizontal resolution .H is 24u
ll: 49u; .l: 48u
ll: 48u; .l: 48u
ll: 47u; .l: 48u
ll: 46u; .l: 48u
ll: 45u; .l: 48u
ll: 44u; .l: 48u
ll: 43u; .l: 48u
ll: 42u; .l: 48u
ll: 41u; .l: 48u
ll: 40u; .l: 48u
ll: 39u; .l: 48u
ll: 38u; .l: 48u
ll: 37u; .l: 48u
ll: 36u; .l: 24u
ll: 35u; .l: 24u
ll: 34u; .l: 24u
ll: 33u; .l: 24u
ll: 32u; .l: 24u
ll: 31u; .l: 24u
ll: 30u; .l: 24u
ll: 29u; .l: 24u
ll: 28u; .l: 24u
ll: 27u; .l: 24u
ll: 26u; .l: 24u
ll: 25u; .l: 24u
ll: 24u; .l: 24u
ll: 23u; .l: 24u
ll: 22u; .l: 24u
ll: 21u; .l: 24u
ll: 20u; .l: 24u
ll: 19u; .l: 24u
ll: 18u; .l: 24u
ll: 17u; .l: 24u
ll: 16u; .l: 24u
ll: 15u; .l: 24u
ll: 14u; .l: 24u
ll: 13u; .l: 24u
ll: 12u; .l: 24u
ll: 11u; .l: 24u
ll: 10u; .l: 24u
ll: 9u; .l: 24u
ll: 8u; .l: 24u
ll: 7u; .l: 24u
ll: 6u; .l: 24u
ll: 5u; .l: 24u
ll: 4u; .l: 24u
ll: 3u; .l: 24u
ll: 2u; .l: 24u
ll: 1u; .l: 24u
ll: 0u; .l: 24u


The output line length is not permitted to be less than the output device's horizontal resolution, and moreover it is not allowed to be zero.

groff has, historically, permitted this, but it does not appear to have been a deliberate design decision.  The code was not written to handle this case (see bug #61089 and bug #44018).

John Gardner found himself exploring in this part of the design space, as shown in bug #61089.

If we're going to define semantics for an output line length of zero as a groff extension, we should do so after consulting the mailing list and in conjunction with appropriate documentation.  That'll be a separate ticket.

For now, we should make groff behave like Heirloom Doctools (unless I find enough contradictory practice in other implementations, but that will take a bit of time).


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:
   

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

    Date Changed by Updated Field Previous Value => Replaced by
    2021-09-07 gbranden StatusIn Progress Fixed
        Open/ClosedOpen Closed
        Planned ReleaseNone 1.23.0

    Back to the top

    Powered by Savane 3.13-4448.
    Corresponding source code