bugGNU troff - Bugs: bug #63099, nroff/troff difference when...

 
 

bug #63099: nroff/troff difference when measuring arguments in compatibility mode

Submitter:  G. Branden Robinson <gbranden>
Submitted:  Sat 24 Sep 2022 04:59:28 PM UTC
 
Category:  Core Severity:  2 - Minor
Item Group:  Warning/Suspicious behaviour Status:  None
Privacy:  Public Assigned to:  None
Open/Closed:  Open Planned Release:  None
* Mandatory Fields

Add a New Comment (Rich Markup)
   

Comment Type & Canned Response:
       No canned response available

 

Sat 24 Sep 2022 04:59:28 PM UTC, original submission:  

This surprised me.

Input:

.de Mw
.  nr wd \w'\\$1'
.  tm "\\$1" is \\n(wd units wide.
..
.Mw Wet'suwet'en
.Mw Wet'+200i
.cp 1 \" turn on compatibility mode
.Mw Wet'suwet'en
.Mw Wet'
.Mw Wet'+200i

With compatibility mode on, we would expect the first embedded ' character to terminate the argument given to the \w escape sequence.

And for PostScript output, it does.

"Wet'suwet'en" is 54740 units wide.
"Wet'+200i" is 42610 units wide.
"Wet'suwet'en" is 15860 units wide.
"Wet'" is 15860 units wide.
"Wet'+200i" is 14415860 units wide.

But watch what happens when we try a terminal device.

"Wet'suwet'en" is 288 units wide.
"Wet'+200i" is 216 units wide.
"Wet'suwet'en" is 240 units wide.
"Wet'" is 72 units wide.
"Wet'+200i" is 48072 units wide.

Note the third line.  \w kept reading until it hit the second embedded apostrophe.

This is pretty bizarre but I can't bring myself to set it to a higher severity than "minor" because it seems to me like a pretty obscure corner case--using compatibility mode and inside knowledge of the delimiter to be used inside a macro you're calling.

Still, I'm curious to research this, maybe for groff 1.24.

G. Branden Robinson <gbranden>
Project 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.

     

     

     

     

    No changes have been made to this item

    Back to the top

    Powered by Savane 3.9