[bug #54538] [PATCH] hdmisc.tmac-u: macro t*index: Fix the end value of a while loop

2023-07-28 Thread Dave
Update of bug #54538 (project groff):

  Status:   Need Info => None   

___

Follow-up Comment #3:

[comment #2 comment #2:]
> My patch was the result of adding "-b -ww" to "GROFFBIN" in
> "Makefile.am" to make the reported warnings superfluous.

In that case, I have concerns that the issues Ingo raised in comment 3 of bug
#55044 apply here as well.

Without even minimal hdtbl input to demonstrate a misbehavior being corrected
(especially given that there are no hdtbl regression tests among the numerous
tests Branden has added throughout the groff tree in recent years), patching
the code seems just as likely to create problems as to fix them.


___

Reply to this item at:

  

___
Message sent via Savannah
https://savannah.gnu.org/




[bug #54538] [PATCH] hdmisc.tmac-u: macro t*index: Fix the end value of a while loop

2023-07-23 Thread Bjarni Ingi Gislason
Follow-up Comment #2, bug #54538 (project groff):

  My patch was the result of adding "-b -ww" to "GROFFBIN" in
"Makefile.am" to make the reported warnings superfluous.



___

Reply to this item at:

  

___
Message sent via Savannah
https://savannah.gnu.org/




[bug #54538] [PATCH] hdmisc.tmac-u: macro t*index: Fix the end value of a while loop

2023-07-22 Thread Dave
Update of bug #54538 (project groff):

  Status:None => Need Info  

___

Follow-up Comment #1:

[http://git.savannah.gnu.org/cgit/groff.git/commit/?id=f2f52b9a Commit
f2f52b9a] renamed contrib/hdtbl/hdmisc.tmac-u to contrib/hdtbl/hdmisc.tmac, so
the given patch no longer applies as-is, but it does apply if the filename is
manually edited.

However, it is unclear what bug the patch is supposed to fix.  Bjarni, can you
provide a simple example input file that works incorrectly without the patch
and correctly with it?


___

Reply to this item at:

  

___
Message sent via Savannah
https://savannah.gnu.org/




[bug #54538] [PATCH] hdmisc.tmac-u: macro t*index: Fix the end value of a while loop

2018-11-26 Thread Bertrand Garrigues
Update of bug #54538 (project groff):

Severity:  3 - Normal => 2 - Minor  
  Item Group:None => Warning/Suspicious
behaviour


___

Reply to this item at:

  

___
  Message sent via Savannah
  https://savannah.gnu.org/


___
bug-groff mailing list
bug-groff@gnu.org
https://lists.gnu.org/mailman/listinfo/bug-groff


[bug #54538] [PATCH] hdmisc.tmac-u: macro t*index: Fix the end value of a while loop

2018-08-19 Thread Bjarni Ingi Gislason
URL:
  

 Summary: [PATCH] hdmisc.tmac-u: macro t*index: Fix the end
value of a while  loop
 Project: GNU troff
Submitted by: bjarniig
Submitted on: Sun 19 Aug 2018 07:44:32 PM UTC
Category: Macro - others
Severity: 3 - Normal
  Item Group: None
  Status: None
 Privacy: Public
 Assigned to: None
 Open/Closed: Open
 Discussion Lock: Any
 Planned Release: None

___

Details:


>From cfb9555eaf69442a682b4e8f02b580e81c0d080d Mon Sep 17 00:00:00 2001
From: Bjarni Ingi Gislason 
Date: Sun, 19 Aug 2018 19:31:29 +
Subject: [PATCH] hdmisc.tmac-u: macro t*index: Fix the end value of a while
 loop

  Check if the second string is longer than the first one.

  The end value for the comparison of the strings is too large.

Signed-off-by: Bjarni Ingi Gislason 
---
 contrib/hdtbl/hdmisc.tmac-u | 9 +++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/contrib/hdtbl/hdmisc.tmac-u b/contrib/hdtbl/hdmisc.tmac-u
index 33111eb5..b001561f 100644
--- a/contrib/hdtbl/hdmisc.tmac-u
+++ b/contrib/hdtbl/hdmisc.tmac-u
@@ -158,7 +158,12 @@ along with this program.  If not, see
.
 .  length $2 \\$2
 .  nr * 0-1 1
 .
-.  while (\\n+[*] < \\n[**]) \{\
+.  if \\n[$2]>\\n[**] \{\
+.nr t*index 0
+.return
+.  \}
+.
+.  while (\\n+[*] < (\\n[**]-\\n[$2]) ) \{\
 .ds * \\$1\"
 .substring * \\n[*] (\\n[*] + \\n[$2] - 1)
 .\" The surrounding \? escapes emulate string comparison.
@@ -166,7 +171,7 @@ along with this program.  If not, see
.
 .  break
 .  \}
 .
-.  ie (\\n[*] == \\n[**]) \
+.  ie (\\n[*] == (\\n[**]-\\n[$2]) ) \
 .nr t*index 0
 .  el \
 .nr t*index (\\n[*] + 1)
-- 
2.18.0






___

Reply to this item at:

  

___
  Message sent via Savannah
  https://savannah.gnu.org/


___
bug-groff mailing list
bug-groff@gnu.org
https://lists.gnu.org/mailman/listinfo/bug-groff