[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[groff] 26/31: [ms]: Validate `PS` arguments better.
From: |
G. Branden Robinson |
Subject: |
[groff] 26/31: [ms]: Validate `PS` arguments better. |
Date: |
Wed, 17 Aug 2022 01:26:06 -0400 (EDT) |
gbranden pushed a commit to branch master
in repository groff.
commit b16ad66b8e4d50ba0b76536833eab853fc2ff8d0
Author: G. Branden Robinson <g.branden.robinson@gmail.com>
AuthorDate: Mon Aug 15 00:24:48 2022 -0500
[ms]: Validate `PS` arguments better.
* tmac/s.tmac (@PS): Validate better; check for 2 arguments exactly.
Also improve diagnostic message wording.
---
ChangeLog | 5 +++++
tmac/s.tmac | 7 ++++++-
2 files changed, 11 insertions(+), 1 deletion(-)
diff --git a/ChangeLog b/ChangeLog
index 4bddb824d..87900afd4 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2022-08-15 G. Branden Robinson <g.branden.robinson@gmail.com>
+
+ * tmac/s.tmac (@PS): Validate better; check for 2 arguments
+ exactly.
+
2022-08-14 G. Branden Robinson <g.branden.robinson@gmail.com>
[pic]: Recognize `.PY` as synonym of `.PF`.
diff --git a/tmac/s.tmac b/tmac/s.tmac
index 15df9dc81..ec9602489 100644
--- a/tmac/s.tmac
+++ b/tmac/s.tmac
@@ -2058,7 +2058,12 @@ along with this program. If not, see
<http://www.gnu.org/licenses/>.
.de @PS
.br
.sp \\n[DD]u
-.ie \\n[.$]<2 .@error bad arguments to .PS (not preprocessed with pic?)
+.ie !\\n[.$]=2 \{\
+. ds pic*msg .PS: expected 2 arguments, got \\n[.$]\"
+. as pic*msg ; not preprocessed with pic?\"
+. @error \\*[pic*msg]
+. rm pic*msg
+.\}
.el \{\
. ds@need (u;\\$1)+1v
. in +(u;\\n[.l]-\\n[.i]-\\$2/2>?0)
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [groff] 26/31: [ms]: Validate `PS` arguments better.,
G. Branden Robinson <=