]> ncurses.scripts.mit.edu Git - ncurses.git/blobdiff - progs/tic.c
ncurses 6.4 - patch 20231104
[ncurses.git] / progs / tic.c
index d8052648feb4ce4f9f8946a7184e85b208ea57ed..ae65e6317f0a625186724001cd346eb809a58d5f 100644 (file)
@@ -49,7 +49,7 @@
 #include <parametrized.h>
 #include <transform.h>
 
-MODULE_ID("$Id: tic.c,v 1.322 2023/05/27 20:13:10 tom Exp $")
+MODULE_ID("$Id: tic.c,v 1.324 2023/11/04 19:43:43 tom Exp $")
 
 #define STDIN_NAME "<stdin>"
 
@@ -459,17 +459,20 @@ open_input(const char *filename, char *alt_file)
     if (!strcmp(filename, "-")) {
        fp = copy_input(stdin, STDIN_NAME, alt_file);
     } else if (stat(filename, &sb) == -1) {
-       fprintf(stderr, "%s: %s %s\n", _nc_progname, filename, strerror(errno));
+       fprintf(stderr, "%s: cannot open '%s': %s\n", _nc_progname,
+               filename, strerror(errno));
        ExitProgram(EXIT_FAILURE);
     } else if ((mode = (sb.st_mode & S_IFMT)) == S_IFDIR
               || (mode != S_IFREG && mode != S_IFCHR && mode != S_IFIFO)) {
-       fprintf(stderr, "%s: %s is not a file\n", _nc_progname, filename);
+       fprintf(stderr, "%s: cannot open '%s'; it is not a file\n",
+               _nc_progname, filename);
        ExitProgram(EXIT_FAILURE);
     } else {
        fp = safe_fopen(filename, "r");
 
        if (fp == NULL) {
-           fprintf(stderr, "%s: Can't open %s\n", _nc_progname, filename);
+           fprintf(stderr, "%s: cannot open '%s': %s\n", _nc_progname,
+                   filename, strerror(errno));
            ExitProgram(EXIT_FAILURE);
        }
        if (mode != S_IFREG) {
@@ -477,7 +480,8 @@ open_input(const char *filename, char *alt_file)
                FILE *fp2 = copy_input(fp, filename, alt_file);
                fp = fp2;
            } else {
-               fprintf(stderr, "%s: %s is not a file\n", _nc_progname, filename);
+               fprintf(stderr, "%s: cannot open '%s'; it is not a"
+                       " file\n", _nc_progname, filename);
                ExitProgram(EXIT_FAILURE);
            }
        }
@@ -3145,6 +3149,7 @@ guess_ANSI_VTxx(TERMTYPE2 *tp)
  * In particular, any ECMA-48 terminal should support these, though the details
  * for u9 are implementation dependent.
  */
+#if defined(user6) && defined(user7) && defined(user8) && defined(user9)
 static void
 check_user_6789(TERMTYPE2 *tp)
 {
@@ -3180,6 +3185,9 @@ check_user_6789(TERMTYPE2 *tp)
        break;
     }
 }
+#else
+#define check_user_6789(tp)    /* nothing */
+#endif
 
 /* other sanity-checks (things that we don't want in the normal
  * logic that reads a terminfo entry)