gbranden pushed a commit to branch master
in repository groff.

commit 7ac7be3b2d3336c7efeb1310a3851ec30712cdc7
Author: G. Branden Robinson <[email protected]>
AuthorDate: Sat Dec 6 18:29:29 2025 -0600

    [xtotroff]: Reword some error diagnostics.
    
    * src/utils/xtotroff/xtotroff.c (MapFont, main): Tweak wording of error
      diagnostics; favor "cannot" over "unable to" or "can't".  Also quote
      name of environment variable.
    
    See commit 6154b19609, 26 June.
---
 ChangeLog                     |  6 ++++++
 src/utils/xtotroff/xtotroff.c | 15 +++++++--------
 2 files changed, 13 insertions(+), 8 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 855fe7a42..45baeca0b 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2025-12-06  G. Branden Robinson <[email protected]>
+
+       * src/utils/xtotroff/xtotroff.c (MapFont, main): Tweak wording
+       of error diagnostics; favor "cannot" over "unable to" or
+       "can't".  Also quote name of environment variable.
+
 2025-12-06  G. Branden Robinson <[email protected]>
 
        * src/utils/xtotroff/xtotroff.c: Fix code style nit.
diff --git a/src/utils/xtotroff/xtotroff.c b/src/utils/xtotroff/xtotroff.c
index 39241cfb2..6398b5237 100644
--- a/src/utils/xtotroff/xtotroff.c
+++ b/src/utils/xtotroff/xtotroff.c
@@ -201,7 +201,7 @@ static bool MapFont(char *font_name, const char *troff_name)
     file_name = malloc(dirlen + baselen + 2 /* '/' and '\0' */);
     if (NULL == file_name) {
       (void) fprintf(stderr, "%s: fatal error:"
-                    " unable to allocate memory\n", program_name);
+                    " cannot allocate memory\n", program_name);
       xtotroff_exit(EXIT_FAILURE);
     }
     (void) strcpy(file_name, destdir);
@@ -217,7 +217,7 @@ static bool MapFont(char *font_name, const char *troff_name)
   }
 
   if (NULL == out) {
-    (void) fprintf(stderr, "%s: unable to create '%s': %s\n",
+    (void) fprintf(stderr, "%s: cannot create '%s': %s\n",
                   program_name, file_name, strerror(errno));
     free(file_name);
     return false;
@@ -347,18 +347,17 @@ int main(int argc, char **argv)
   dpy = XOpenDisplay(0);
   if (!dpy) {
     (void) fprintf(stderr,
-                  "%s: fatal error: can't connect to the X server;"
-                  " make sure the DISPLAY environment variable is set"
-                  " correctly\n", program_name);
+                  "%s: fatal error: cannot connect to the X server;"
+                  " make sure the \"DISPLAY\" environment variable is"
+                  " set correctly\n", program_name);
     xtotroff_exit(EXIT_FAILURE);
   }
 
   map = fopen(argv[optind], "r");
   if (NULL == map) {
     (void) fprintf(stderr,
-                  "%s: fatal error: unable to open map file '%s':"
-                  " %s\n", program_name, argv[optind],
-                  strerror(errno));
+                  "%s: fatal error: cannot map file '%s': %s\n",
+                  program_name, argv[optind], strerror(errno));
     xtotroff_exit(EXIT_FAILURE);
   }
 

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

Reply via email to