gbranden pushed a commit to branch master
in repository groff.

commit f40269f35010d9baf90b83b0d70d97093a51ee71
Author: G. Branden Robinson <[email protected]>
AuthorDate: Thu Feb 1 15:52:24 2024 -0600

    [grotty]: Improve error diagnostic.
    
    * src/devices/grotty/tty.cpp (tty_printer::special): Improve diagnostic
      message when handling unsupported device control command: report name
      of unrecognized tag.
---
 ChangeLog                  | 6 ++++++
 src/devices/grotty/tty.cpp | 3 ++-
 2 files changed, 8 insertions(+), 1 deletion(-)

diff --git a/ChangeLog b/ChangeLog
index 6d0250e52..f3002a679 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2024-02-01  G. Branden Robinson <[email protected]>
+
+       * src/devices/grotty/tty.cpp (tty_printer::special): Improve
+       diagnostic message when handling unsupported device control
+       command: report name of unrecognized tag.
+
 2024-02-01  G. Branden Robinson <[email protected]>
 
        * tmac/tests/an_MT-works.sh:
diff --git a/src/devices/grotty/tty.cpp b/src/devices/grotty/tty.cpp
index 070ee2e30..326482bd4 100644
--- a/src/devices/grotty/tty.cpp
+++ b/src/devices/grotty/tty.cpp
@@ -433,7 +433,8 @@ void tty_printer::special(char *arg, const environment 
*env, char type)
   for (; *p != '\0' && *p != ':' && *p != ' ' && *p != '\n'; p++)
     ;
   if (*p == '\0' || strncmp(tag, "tty", p - tag) != 0) {
-    error("X command without 'tty:' tag ignored");
+    *p = '\0'; // terminate string at colon
+    error("X command with '%1' tag ignored; expected 'tty'", tag);
     return;
   }
   p++;

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

Reply via email to