bugGNU roff - Bugs: bug #51376, [troff] using `itc` request causes...

 
 

bug #51376: [troff] using `itc` request causes subsequent `it` requests to behave like `itc`

Submitter:  Bjarni Ingi Gislason <bjarniig>
Submitted:  Mon 03 Jul 2017 09:30:50 PM UTC
   
 
Category:  Core Severity:  3 - Normal
Item Group:  Incorrect behaviour Status:  Fixed
Privacy:  Public Assigned to:  bgarrigues
Open/Closed:  Closed Planned Release:  1.22.4
* Mandatory Fields

Add a New Comment Rich Markup
   

Wed 15 Jun 2022 05:46:23 PM UTC, comment #3: 


commit ffb05e28da383eb3c42fd858189e950073d957be
Author:     Bjarni Ingi Gislason <bjarniig@rhi.hi.is>
AuthorDate: Fri Jul 14 13:34:57 2017 +0000
Commit:     Bertrand Garrigues <bertrand.garrigues@laposte.net>
CommitDate: Sat Aug 26 00:12:40 2017 +0200

    Fix bug: `.itc' request breaks subsequent `.it' requests.

    See bug at: https://savannah.gnu.org/bugs/?51376.  Using `.itc'
    lets all later uses of `.it' behave like `.itc', that is,
    interrupted text line ending with \c is not counted as a separate
    line.

    * env.cpp: Restore input_trap state to normal when '.it' is
    called.


G. Branden Robinson <gbranden>
Group administrator
Fri 25 Aug 2017 10:14:53 PM UTC, comment #2: 

Commited, thanks,

Bertrand Garrigues <bgarrigues>
Group administrator
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
 called

  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)
--
2.13.2


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
"an-old.tmac".

  Constructed file for a test case is:

.de R
.ft R
..
.
.pl 5
.ft B
Something
is
.\" also change .itc into .it
.itc 1 R
in\c
the
air.
.ft B
.it 1 R
In\c
the
air
.br
.ft B
Something
is
.it 1 R
in\c
the
air.
.ft B
.it 1 R
In\c
the
air


  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:
   
   
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 (Updated the item)
  • -email is unavailable- added by bgarrigues (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
    2023-04-01 gbranden Planned ReleaseNone 1.22.4
        SummaryBug in the request &quot;itc&quot;; makes request &quot;it&quot; behave the same way [troff] using `itc` request causes subsequent `it` requests to behave like `itc`
    2022-06-15 gbranden CategoryNone Core
    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.13-4448.
    Corresponding source code