bugGNU troff - Bugs: bug #42675, \} considered as macro argument...


bug #42675: \} considered as macro argument regarding register .$

Submitted by:  None
Submitted on:  Thu 03 Jul 2014 09:35:26 PM UTC  
Category: NoneSeverity: 3 - Normal
Item Group: NoneStatus: None
Privacy: PublicAssigned to: None
Open/Closed: OpenPlanned Release: None

Add a New Comment(Rich Markup)

You are not logged in

Please log in, so followups can be emailed to you.


Fri 19 Sep 2014 07:49:47 PM UTC, comment #3:

Although this bug seems to be in any existing *roff implementation, it should be fixed. At the moment the \n(.$ register can't be used in a macro that may be invoked by other users because it has a random value, which depends on if the user writes

.A \}



To make \n(.$ meaningful again and make it fit it's documentation this bug should be fixed. This breaks "compatibility" with traditional *roff but only in cases where the input relies on side effects of this bug. Because of it's random nature such cases are unlikely.

Carsten Kunze <carstenkunze>
Project Member
Tue 29 Jul 2014 11:18:22 AM UTC, comment #2:

Second thread at


Tue 29 Jul 2014 11:16:02 AM UTC, comment #1:

groff mailing list thread starts at


Thu 03 Jul 2014 09:35:26 PM UTC, original submission:

(Attention: This may or may not be a bug! It could have been intentionally be introduced to groff to implement traditional nroff behavior perfectly. In this case it should be added to the documentation only.)

If a macro is used as the last statement of a conditional statement block (a block enclosed in \{ and \}), the closing \} is on the same line as the macro call and there is white space before \} the register .$ is increased by 1.

How to reproduce (thanks to Ingo Schwarze):

Minimal input file:
.de count_args
.if n \{.count_args\}
.if n \{.count_args \}
.if n \{.count_args foo\}
.if n \{.count_args foo \}

Run this through:
groff -Wall -Tascii

Output with groff-1.22.2 on OpenBSD:

  1. 1 1 2


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

Attach File(s):

No files currently attached


Depends on the following items: None found

Items that depend on this one: None found


Carbon-Copy List
  • -unavailable- added by carstenkunze (Posted a comment)

    Do you think this task is very important?
    If so, you can click here to add your encouragement to it.
    This task has 0 encouragements so far.

    Only logged-in users can vote.


    Please enter the title of George Orwell's famous dystopian book (it's a date):



    No Changes Have Been Made to This Item

    Back to the top

    Powered by Savane 3.1-cleanup1