[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[bug #62455] [PATCH] tmac/an.tmac: fix the "an-extra3" algorithm when th
From: |
Bjarni Ingi Gislason |
Subject: |
[bug #62455] [PATCH] tmac/an.tmac: fix the "an-extra3" algorithm when the fifth argument to 'TH' is empty |
Date: |
Fri, 13 May 2022 15:30:40 -0400 (EDT) |
URL:
<https://savannah.gnu.org/bugs/?62455>
Summary: [PATCH] tmac/an.tmac: fix the "an-extra3" algorithm
when the fifth argument to 'TH' is empty
Project: GNU troff
Submitted by: bjarniig
Submitted on: Fri 13 May 2022 07:30:39 PM UTC
Category: Macro man
Severity: 3 - Normal
Item Group: Incorrect behaviour
Status: None
Privacy: Public
Assigned to: None
Open/Closed: Open
Discussion Lock: Any
Planned Release: None
_______________________________________________________
Details:
>From a65c7e1ad7b5bcf5fecd2b91fb02fe192627b19b Mon Sep 17 00:00:00 2001
From: Bjarni Ingi Gislason <bjarniig@rhi.hi.is>
Date: Fri, 13 May 2022 19:23:36 +0000
Subject: [PATCH] tmac/an.tmac: fix the "an-extra3" algorithm when the fifth
argument to 'TH' is empty
The logical operator 'and' (&) is only for numeric expressions.
Use boolean values for the numeric '>' and the string
'...'...' comparison.
Bug seen in the output of "man 5 libsasl".
Signed-off-by: Bjarni Ingi Gislason <bjarniig@rhi.hi.is>
---
tmac/an.tmac | 16 +++++++++++++++-
1 file changed, 15 insertions(+), 1 deletion(-)
diff --git a/tmac/an.tmac b/tmac/an.tmac
index 38ce146a4..7c7911982 100644
--- a/tmac/an.tmac
+++ b/tmac/an.tmac
@@ -276,7 +276,21 @@
. ds an-title "\\$1\"
. if \\n[CT] .stringup an-title
. ds an-section "\\$2\"
-. ie (\\n[.$] > 4) .ds an-extra3 "\\$5\"
+.
+.\" operator '&' is only for numeric expressions
+.\" use boolean values
+.ie (\\n[.$] > 4) \{\
+. nr an-nr-bool 1
+. ie '\\$5'' .nr an-str-bool 0
+. el .nr an-str-bool 1
+.\}
+.el \{\
+. nr an-nr-bool 0
+. nr an-str-bool 0
+.\}
+.ie (\\n[an-nr-bool] & \\n[an-str-bool]) .ds an-extra3 "\\$5
+.\" end of boolean values
+.
. el \{ .ie '\\$2'1' .ds an-extra3 \\*[an*section1]\"
. el \{ .ie '\\$2'2' .ds an-extra3 \\*[an*section2]\"
. el \{ .ie '\\$2'3' .ds an-extra3 \\*[an*section3]\"
--
2.35.1
_______________________________________________________
Reply to this item at:
<https://savannah.gnu.org/bugs/?62455>
_______________________________________________
Message sent via Savannah
https://savannah.gnu.org/
- [bug #62455] [PATCH] tmac/an.tmac: fix the "an-extra3" algorithm when the fifth argument to 'TH' is empty,
Bjarni Ingi Gislason <=