gbranden pushed a commit to branch master
in repository groff.

commit 6f08ec9815886e59df73e102d5aa6194bb1c0fa5
Author: G. Branden Robinson <[email protected]>
AuthorDate: Wed Sep 4 04:12:56 2024 -0500

    [troff]: Fix Savannah #60995 (`f` scaling unit).
    
    * src/roff/troff/number.cpp (is_valid_term): Reject scaling units other
      than `f` in contexts where `f` is expected (dimensionless values in
      the unit interval expressing the magnitude of a color channel}.
    
    Fixes <https://savannah.gnu.org/bugs/?60995>.
---
 ChangeLog                 | 9 +++++++++
 src/roff/troff/number.cpp | 8 ++++++++
 2 files changed, 17 insertions(+)

diff --git a/ChangeLog b/ChangeLog
index 4a6329af6..762fea984 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,12 @@
+2024-09-04  G. Branden Robinson <[email protected]>
+
+       * src/roff/troff/number.cpp (is_valid_term): Reject scaling
+       units other than `f` in contexts where `f` is expected
+       {dimensionless values in the unit interval expressing the
+       magnitude of a color channel}.
+
+       Fixes <https://savannah.gnu.org/bugs/?60995>.
+
 2024-09-04  G. Branden Robinson <[email protected]>
 
        * src/roff/troff/number.cpp (is_valid_term): Accept `p` and `s`
diff --git a/src/roff/troff/number.cpp b/src/roff/troff/number.cpp
index d3b4fcadd..b8fce3739 100644
--- a/src/roff/troff/number.cpp
+++ b/src/roff/troff/number.cpp
@@ -540,6 +540,14 @@ static bool is_valid_term(units *u, int scaling_unit,
     case 0:
       warning(WARN_SCALE, "scaling unit invalid in context");
       break;
+    case 'f':
+      if (c != 'f') {
+       warning(WARN_SCALE, "'%1' scaling unit invalid in context;"
+               " use 'f'", c);
+       break;
+      }
+      si = c;
+      break;
     case 'z':
       if (c != 'u' && c != 'z' && c != 'p' && c != 's') {
        warning(WARN_SCALE, "'%1' scaling unit invalid in context;"

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

Reply via email to