groff-commit
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[groff] 18/33: tmac/e.tmac: Add bounds check.


From: G. Branden Robinson
Subject: [groff] 18/33: tmac/e.tmac: Add bounds check.
Date: Thu, 30 Dec 2021 00:46:48 -0500 (EST)

gbranden pushed a commit to branch temp-mail-fail
in repository groff.

commit 28d68754c3c9178b02bf7cce5fca41eba4fced9a
Author: G. Branden Robinson <g.branden.robinson@gmail.com>
AuthorDate: Sat Dec 25 02:58:53 2021 +1100

    tmac/e.tmac: Add bounds check.
    
    * tmac/e.tmac ()c): Add bounds check to avoid attempting to set a
      negative indentation, provoking a troff warning.  Problem exposed by
      formatting "meintro_fr.me" document with default nroff mode line
      length.
---
 ChangeLog   | 7 +++++++
 tmac/e.tmac | 5 ++++-
 2 files changed, 11 insertions(+), 1 deletion(-)

diff --git a/ChangeLog b/ChangeLog
index 9d81e5a5..9c029dd5 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2021-12-25  G. Branden Robinson <g.branden.robinson@gmail.com>
+
+       * tmac/e.tmac ()c): Add bounds check to avoid attempting to set
+       a negative indentation, provoking a troff warning.  Problem
+       exposed by formatting "meintro_fr.me" document with default
+       nroff mode line length.
+
 2021-12-24  G. Branden Robinson <g.branden.robinson@gmail.com>
 
        [troff]: Slightly refactor (boolify).
diff --git a/tmac/e.tmac b/tmac/e.tmac
index 463d0932..89447d3f 100644
--- a/tmac/e.tmac
+++ b/tmac/e.tmac
@@ -1133,7 +1133,10 @@
 .if \n@>4 .tm >> .)c .l=\\n(.l .i=\\n(.i $i=\\n($i dl=\\n(dl
 .ev 1
 .ls 1
-.in (\\n(.lu-\\n(.iu-\\n(dlu)/2u
+.nr __ (\\n(.lu-\\n(.iu-\\n(dlu)/2u
+.if \\n(__u<0 .nr __ 0
+.in \\n(__u
+.rr __
 .if \n@>4 .tm -- .)c << .in .l=\\n(.l .i=\\n(.i dl=\\n(dl
 .if \\n(?n \
 .      nm \\n(ln



reply via email to

[Prev in Thread] Current Thread [Next in Thread]