gbranden pushed a commit to branch master
in repository groff.

commit 9823a2054566b2b83de80e85a4bb39b03ea4c635
Author: G. Branden Robinson <[email protected]>
AuthorDate: Mon Jan 16 13:02:31 2023 -0600

    [mm]: Handle bogus arguments to `PIC`.
    
    * contrib/mm/m.tmac (PIC): Bomb out (with diagnostic) if either of the
      width or height arguments are not numeric expressions.
---
 contrib/mm/ChangeLog | 5 +++++
 contrib/mm/m.tmac    | 4 ++++
 2 files changed, 9 insertions(+)

diff --git a/contrib/mm/ChangeLog b/contrib/mm/ChangeLog
index dfa2e719e..822be548e 100644
--- a/contrib/mm/ChangeLog
+++ b/contrib/mm/ChangeLog
@@ -1,3 +1,8 @@
+2023-01-16  G. Branden Robinson <[email protected]>
+
+       * m.tmac (PIC): Bomb out (with diagnostic) if either of the
+       width or height arguments are not numeric expressions.
+
 2023-01-16  G. Branden Robinson <[email protected]>
 
        * m.tmac (EPIC): Handle and shift off a leading "-L" argument
diff --git a/contrib/mm/m.tmac b/contrib/mm/m.tmac
index f81f29f1c..58e2fbaff 100644
--- a/contrib/mm/m.tmac
+++ b/contrib/mm/m.tmac
@@ -835,10 +835,14 @@ in=\\n[.i] fi=\\n[.u] .d=\\n[.d] nl=\\n[nl] pg=\\n[%]
 .      nr pict*id +1
 .      shift
 .      if \\n[.$]>0 \{\
+.              if !\B'\\$1' .@error \\$0: width parameter is not \
+numeric; got '\\$1'
 .              nr pict*width (i;\\$1)
 .              shift
 .      \}
 .      if \\n[.$]>0 \{\
+.              if !\B'\\$1' .@error \\$0: height parameter is not \
+numeric; got '\\$1'
 .              nr pict*height (i;\\$1)
 .              shift
 .      \}

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

Reply via email to