[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[bug #64438] [ms] validation of `PS` macro arguments too strict
From: |
G. Branden Robinson |
Subject: |
[bug #64438] [ms] validation of `PS` macro arguments too strict |
Date: |
Mon, 17 Jul 2023 20:09:27 -0400 (EDT) |
Update of bug #64438 (project groff):
Status: Confirmed => In Progress
_______________________________________________________
Follow-up Comment #2:
To clarify, the bug stops `ne` and `in` requests from being issued for _pic_
pictures. Omitting the former could cause a picture to be truncated by the
bottom of the page. The latter means that the picture will likely not be
correctly centered.
Proposed fix:
diff --git a/tmac/s.tmac b/tmac/s.tmac
index 5fc1237eb..5f9452ee8 100644
--- a/tmac/s.tmac
+++ b/tmac/s.tmac
@@ -2095,7 +2095,7 @@ along with this program. If not, see
<http://www.gnu.org/licenses/>.
.de @PS
.br
.sp \\n[DD]u
-.ie !\\n[.$]=2 \{\
+.ie \\n[.$]<2 \{\
. ds pic*msg .PS: expected 2 arguments, got \\n[.$]\"
. as pic*msg ; not preprocessed with pic?\"
. @error \\*[pic*msg]
@@ -2105,6 +2105,8 @@ along with this program. If not, see
<http://www.gnu.org/licenses/>.
. ds@need (u;\\$1)+1v
. in +(u;\\n[.l]-\\n[.i]-\\$2/2>?0)
.\}
+.if \\n[.$]>2 \
+. @warning .PS: ignoring excess arguments
.HTML-IMAGE
..
.de PF
Any problem with warning about the excess arguments? I feel an urge to do so
because the macro package does nothing with them (DWB 3.3 ms didn't, either).
I wouldn't want a pic/ms user to assume that these extra arguments become a
figure caption or something fancy like that.
_______________________________________________________
Reply to this item at:
<https://savannah.gnu.org/bugs/?64438>
_______________________________________________
Message sent via Savannah
https://savannah.gnu.org/