gbranden pushed a commit to branch master
in repository groff.

commit 1268a8b754b51735a1f7a34daa3bd0f81893b23c
Author: G. Branden Robinson <[email protected]>
AuthorDate: Sun Apr 20 21:52:19 2025 -0500

    [troff]: Improve diagnostic message.
    
    * src/roff/troff/node.cpp (font_lookup_info): When complaining, for
      example, that a font can't be loaded because its mounting position was
      unresolvable, don't report a mounting position of "-1" in the message.
      That's an internal sentinel value and meaningless to the user.
---
 ChangeLog               | 8 ++++++++
 src/roff/troff/node.cpp | 2 ++
 2 files changed, 10 insertions(+)

diff --git a/ChangeLog b/ChangeLog
index 8a97859fc..458305b96 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+2025-04-20  G. Branden Robinson <[email protected]>
+
+       * src/roff/troff/node.cpp (font_lookup_info): Improve diagnostic
+       message.  When complaining, for example, that a font can't be
+       loaded because its mounting position was unresolvable, don't
+       report a mounting position of "-1" in the message.  That's an
+       internal sentinel value and meaningless to the user.
+
 2025-04-20  G. Branden Robinson <[email protected]>
 
        [troff]: Fix Savannah #67038.
diff --git a/src/roff/troff/node.cpp b/src/roff/troff/node.cpp
index aaca807a9..9056434dd 100644
--- a/src/roff/troff/node.cpp
+++ b/src/roff/troff/node.cpp
@@ -6715,6 +6715,8 @@ static void font_lookup_error(font_lookup_info& finfo,
 {
   if (finfo.requested_name)
     error("cannot load font '%1' %2", finfo.requested_name, msg);
+  else if (finfo.position == FONT_NOT_MOUNTED)
+    error("cannot load font %1", msg); // don't report position `-1`
   else
     error("cannot load font at position %1 %2",
          finfo.requested_position, msg);

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

Reply via email to