bugGNU troff - Bugs: bug #51376, Bug in the request...


bug #51376: Bug in the request "itc"; makes request "it" behave the same way

Submitted by:  Bjarni Ingi Gislason <bjarniig>
Submitted on:  Mon 03 Jul 2017 09:30:50 PM UTC  
Category:  None Severity:  3 - Normal
Item Group:  Incorrect behaviour Status:  Fixed
Privacy:  Public Assigned to:  Bertrand Garrigues <bgarrigues>
Open/Closed:  Closed Planned Release:  None

Add a New Comment (Rich Markup)

You are not logged in

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


Fri 25 Aug 2017 10:14:53 PM UTC, comment #2: 

Commited, thanks,

Bertrand Garrigues <bgarrigues>
Project AdministratorIn charge of this item.
Fri 14 Jul 2017 05:35:30 PM UTC, comment #1: 

  The following patch eliminated the symptoms from the test case:

From dd44550852361e8e35e6cb49e416956253eb39a7 Mon Sep 17 00:00:00 2001
From: Bjarni Ingi Gislason <bjarniig@rhi.hi.is>
Date: Fri, 14 Jul 2017 13:34:57 +0000
Subject: [PATCH] env.cpp: Restore input_trap state to normal when '.it' is

  Otherwise the request '.itc' lets all later uses of '.it' behave the same
way as itself.

Signed-off-by: Bjarni Ingi Gislason <bjarniig@rhi.hi.is>
src/roff/troff/env.cpp | 2 ++
1 file changed, 2 insertions(+)

diff --git a/src/roff/troff/env.cpp b/src/roff/troff/env.cpp
index 2c82c568..f242d4ee 100644
--- a/src/roff/troff/env.cpp
+++ b/src/roff/troff/env.cpp
@@ -2508,6 +2508,8 @@ void do_input_trap(int continued)
   curenv->input_trap_count = 0;
   if (continued)
     curenv->continued_input_trap = 1;
+  else
+    curenv->continued_input_trap = 0;
   int n;
   if (has_arg() && get_integer(&n)) {
     if (n <= 0)

Bjarni Ingi Gislason <bjarniig>
Mon 03 Jul 2017 09:30:50 PM UTC, original submission:  

  The request "itc" lets the request "it" behave like itself

  Discovered in "groff_hdtbl(7)" while using "itc" in some macros in

  Constructed file for a test case is:

.de R
.ft R
.pl 5
.ft B
.\" also change .itc into .it
.itc 1 R
.ft B
.it 1 R
.ft B
.it 1 R
.ft B
.it 1 R

  Run with "nroff <test-file>" (both versions)

  To me, it looks like that the variable "curenv->continued_input_trap " in
the file "groff/src/roff/troff/env.cpp" is never reset.

Bjarni Ingi Gislason <bjarniig>


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

Attach Files:

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 (Updated the item)
  • -email is unavailable- added by bgarrigues (Posted a comment)
  • -email is unavailable- added by bjarniig (Submitted the item)

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

    Only logged-in users can vote.




    Follow 4 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2018-11-04 gbranden Assigned toNone => bgarrigues
    2017-08-25 bgarrigues Item GroupNone => Incorrect behaviour
        StatusNone => Fixed
        Open/ClosedOpen => Closed

    Back to the top

    Powered by Savane 3.5