gbranden pushed a commit to branch master
in repository groff.

commit c84c754f6748cb5d7cd3b903a90fc8ad11297b10
Author: G. Branden Robinson <[email protected]>
AuthorDate: Tue Jan 6 04:13:17 2026 -0600

    [mm]: Validate arguments to `H` macro.
    
    * contrib/mm/m.tmac (H): Throw error diagnostic if not given mandatory
      argument, or the first argument ("level") is not an arithmetic
      expression.
---
 contrib/mm/ChangeLog | 6 ++++++
 contrib/mm/m.tmac    | 2 ++
 2 files changed, 8 insertions(+)

diff --git a/contrib/mm/ChangeLog b/contrib/mm/ChangeLog
index 16e02b46e..9bb7b60e1 100644
--- a/contrib/mm/ChangeLog
+++ b/contrib/mm/ChangeLog
@@ -1,3 +1,9 @@
+2026-01-06  G. Branden Robinson <[email protected]>
+
+       * m.tmac (H): Throw error diagnostic if not given mandatory
+       argument, or the first argument ("level") is not an arithmetic
+       expression.
+
 2025-12-23  Alexis Hildebrandt <[email protected]>
 
        [mm]: Fix Savannah #67857.
diff --git a/contrib/mm/m.tmac b/contrib/mm/m.tmac
index 3f7398b60..6587eddf7 100644
--- a/contrib/mm/m.tmac
+++ b/contrib/mm/m.tmac
@@ -1179,6 +1179,8 @@ numeric; got '\\$1'
 ..
 .\"-------------
 .de H
+.if \\n[.$]=0 .@error \\$0: expected 1 to 3 arguments, got \\n[.$]
+.if !\B'\\$1' .@error \\$0: level argument is not numeric: '\\$1'
 \\*[debug@dump-args]\\
 .if !r hd*cur-bline .nr hd*cur-bline \\n[nl]
 .br

_______________________________________________
groff-commit mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/groff-commit

Reply via email to