texlive[57073] Build/source/texk/dvipsk: texk/dvipsk: Allow Unicode

commits+takuji at tug.org commits+takuji at tug.org
Sat Dec 5 06:22:51 CET 2020


Revision: 57073
          http://tug.org/svn/texlive?view=revision&revision=57073
Author:   takuji
Date:     2020-12-05 06:22:50 +0100 (Sat, 05 Dec 2020)
Log Message:
-----------
texk/dvipsk: Allow Unicode error messages on Windows console. (Windows only)

Modified Paths:
--------------
    trunk/Build/source/texk/dvipsk/ChangeLog
    trunk/Build/source/texk/dvipsk/bitmapenc.c
    trunk/Build/source/texk/dvipsk/color.c
    trunk/Build/source/texk/dvipsk/dopage.c
    trunk/Build/source/texk/dvipsk/dospecial.c
    trunk/Build/source/texk/dvipsk/download.c
    trunk/Build/source/texk/dvipsk/dvips.c
    trunk/Build/source/texk/dvipsk/dvips.h
    trunk/Build/source/texk/dvipsk/emspecial.c
    trunk/Build/source/texk/dvipsk/finclude.c
    trunk/Build/source/texk/dvipsk/fontdef.c
    trunk/Build/source/texk/dvipsk/header.c
    trunk/Build/source/texk/dvipsk/loadfont.c
    trunk/Build/source/texk/dvipsk/output.c
    trunk/Build/source/texk/dvipsk/pprescan.c
    trunk/Build/source/texk/dvipsk/prescan.c
    trunk/Build/source/texk/dvipsk/resident.c
    trunk/Build/source/texk/dvipsk/scanpage.c
    trunk/Build/source/texk/dvipsk/search.c
    trunk/Build/source/texk/dvipsk/t1part.c
    trunk/Build/source/texk/dvipsk/virtualfont.c
    trunk/Build/source/texk/dvipsk/writet1.c

Modified: trunk/Build/source/texk/dvipsk/ChangeLog
===================================================================
--- trunk/Build/source/texk/dvipsk/ChangeLog	2020-12-05 04:56:57 UTC (rev 57072)
+++ trunk/Build/source/texk/dvipsk/ChangeLog	2020-12-05 05:22:50 UTC (rev 57073)
@@ -3,6 +3,10 @@
 	* NEWS: Mention new/jfm feature.
 	* dospecial.c:
 	Output error of html special not to STDOUT but to STDERR.
+	* dvips.h, {bitmapenc,color,dopage,dospecial,download,dvips,
+	emspecial,finclude,fontdef,header,loadfont,output,pprescan,prescan,
+	resident,scanpage,search,t1part,virtualfont,writet1}.c:
+	Allow Unicode error messages on Windows console. (Windows only)
 
 2020-11-28  Akira Kakuto  <kakuto at w32tex.org>
 

Modified: trunk/Build/source/texk/dvipsk/bitmapenc.c
===================================================================
--- trunk/Build/source/texk/dvipsk/bitmapenc.c	2020-12-05 04:56:57 UTC (rev 57072)
+++ trunk/Build/source/texk/dvipsk/bitmapenc.c	2020-12-05 05:22:50 UTC (rev 57073)
@@ -493,7 +493,7 @@
    for (i=0; i<256 && i<curfnt->maxchars; i++) {
       if ((curfnt->chardesc[i].flags2 & EXISTS) &&
                                 !(bme->existsbm[i>>3] & (1 << (i & 7)))) {
-         fprintf(stderr,
+         fprintf_str(stderr,
 "Can't use PostScript encoding vector for font %s; character %d has no name.\n",
          name, i) ;
          return -1 ;
@@ -564,7 +564,7 @@
  */
 static void bmenc_warn(const char *fontname, const char *msg) {
    if (encodetype3 > 1)
-      fprintf(stderr,
+      fprintf_str(stderr,
          "dvips: Static bitmap font encoding for font %s (and others?): %s.\n",
                    fontname, msg) ;
 }

Modified: trunk/Build/source/texk/dvipsk/color.c
===================================================================
--- trunk/Build/source/texk/dvipsk/color.c	2020-12-05 04:56:57 UTC (rev 57072)
+++ trunk/Build/source/texk/dvipsk/color.c	2020-12-05 05:22:50 UTC (rev 57073)
@@ -180,11 +180,11 @@
    if (q > cstack && outtops == 0) {
 #ifdef SHORTINT
      fprintf(stderr, "You've mistakenly made a global color change ");
-     fprintf(stderr, "to %s within nested colors\n", p);
+     fprintf_str(stderr, "to %s within nested colors\n", p);
      fprintf(stderr, "on page %ld. Will try to recover.\n", pagenum);
 #else   /* ~SHORTINT */
      fprintf(stderr, "You've mistakenly made a global color change ");
-     fprintf(stderr, "to %s within nested colors\n", p);
+     fprintf_str(stderr, "to %s within nested colors\n", p);
      fprintf(stderr, "on page %d. Will try to recover.\n", pagenum);
 #endif  /* ~SHORTINT */
    }

Modified: trunk/Build/source/texk/dvipsk/dopage.c
===================================================================
--- trunk/Build/source/texk/dvipsk/dopage.c	2020-12-05 04:56:57 UTC (rev 57072)
+++ trunk/Build/source/texk/dvipsk/dopage.c	2020-12-05 05:22:50 UTC (rev 57073)
@@ -136,7 +136,7 @@
       /* try fallback */
 #ifdef DEBUG
          if (dd(D_FONTS))
-            fprintf(stderr,
+            fprintf_str(stderr,
               "Fallback pTeX vf:%s char=%d(0x%06x) to %s\n",
                curfnt->name, mychar, mychar, curfnt->localfonts->desc->name);
 #endif /* DEBUG */

Modified: trunk/Build/source/texk/dvipsk/dospecial.c
===================================================================
--- trunk/Build/source/texk/dvipsk/dospecial.c	2020-12-05 04:56:57 UTC (rev 57072)
+++ trunk/Build/source/texk/dvipsk/dospecial.c	2020-12-05 05:22:50 UTC (rev 57073)
@@ -400,7 +400,7 @@
       p++;
 #ifdef DEBUG
    if (dd(D_SPECIAL))
-      fprintf(stderr, "Preprocessing special: %s\n", p);
+      fprintf_str(stderr, "Preprocessing special: %s\n", p);
 #endif
 
 /*
@@ -632,7 +632,7 @@
       p++;
 #ifdef DEBUG
    if (dd(D_SPECIAL))
-      fprintf(stderr, "Processing special: %s\n", p);
+      fprintf_str(stderr, "Processing special: %s\n", p);
 #endif
 
    switch (*p) {

Modified: trunk/Build/source/texk/dvipsk/download.c
===================================================================
--- trunk/Build/source/texk/dvipsk/download.c	2020-12-05 04:56:57 UTC (rev 57072)
+++ trunk/Build/source/texk/dvipsk/download.c	2020-12-05 05:22:50 UTC (rev 57073)
@@ -537,7 +537,7 @@
               fprintf(stderr, "\n");
               prettycolumn = 0;
            }
-           fprintf(stderr, "<%s>", realnameoffile);
+           fprintf_str(stderr, "<%s>", realnameoffile);
            prettycolumn += strlen(realnameoffile) + 2;
         }
         if (! disablecomments)

Modified: trunk/Build/source/texk/dvipsk/dvips.c
===================================================================
--- trunk/Build/source/texk/dvipsk/dvips.c	2020-12-05 04:56:57 UTC (rev 57072)
+++ trunk/Build/source/texk/dvipsk/dvips.c	2020-12-05 05:22:50 UTC (rev 57073)
@@ -367,7 +367,7 @@
    if (prettycolumn > 0)
         fprintf(stderr,"\n");
    prettycolumn = 0;
-   fprintf(stderr, "%s: %s", progname, s);
+   fprintf_str(stderr, "%s: %s", progname, s);
    if (fname) {
      putc (' ', stderr);
      perror (fname);
@@ -1326,19 +1326,19 @@
 #ifdef DEBUG
    if (dd(D_PATHS)) {
 #ifdef SHORTINT
-        fprintf(stderr,"input file %s output file %s swmem %ld\n",
+        fprintf_str(stderr,"input file %s output file %s swmem %ld\n",
 #else /* ~SHORTINT */
-           fprintf(stderr,"input file %s output file %s swmem %d\n",
+           fprintf_str(stderr,"input file %s output file %s swmem %d\n",
 #endif /* ~SHORTINT */
            iname, oname, swmem);
 #ifndef KPATHSEA
-   fprintf(stderr,"tfm path %s\npk path %s\n", tfmpath, pkpath);
-   fprintf(stderr,"fig path %s\nvf path %s\n", figpath, vfpath);
-   fprintf(stderr,"config path %s\nheader path %s\n",
+   fprintf_str(stderr,"tfm path %s\npk path %s\n", tfmpath, pkpath);
+   fprintf_str(stderr,"fig path %s\nvf path %s\n", figpath, vfpath);
+   fprintf_str(stderr,"config path %s\nheader path %s\n",
                   configpath, headerpath);
 #endif
 #ifdef FONTLIB
-   fprintf(stderr,"fli path %s\nfli names %s\n", flipath, fliname);
+   fprintf_str(stderr,"fli path %s\nfli names %s\n", flipath, fliname);
 #endif
    } /* dd(D_PATHS) */
 #endif /* DEBUG */
@@ -1487,7 +1487,7 @@
                   fprintf(stderr, "\n");
                   prettycolumn = 0;
                }
-               fprintf(stderr, "(-> %s) ", oname);
+               fprintf_str(stderr, "(-> %s) ", oname);
                prettycolumn += strlen(oname) + 6;
             }
 #ifdef HPS

Modified: trunk/Build/source/texk/dvipsk/dvips.h
===================================================================
--- trunk/Build/source/texk/dvipsk/dvips.h	2020-12-05 04:56:57 UTC (rev 57072)
+++ trunk/Build/source/texk/dvipsk/dvips.h	2020-12-05 05:22:50 UTC (rev 57073)
@@ -310,6 +310,19 @@
 #define USE_PCLOSE (801)
 #define USE_FCLOSE (802)
 
+/* output Unicode string on console in windows */
+#if defined(KPATHSEA) && defined(WIN32)
+#undef  perror
+#define fprintf_str  win32_fprintf
+#define fputs_str    win32_fputs
+#define putc_str     win32_putc
+#define perror       win32_perror
+#else
+#define fprintf_str  fprintf
+#define fputs_str    fputs
+#define putc_str     putc
+#endif
+
 /* Things that KPATHSEA knows, and are useful even without it. */
 #if !defined(KPATHSEA)
 

Modified: trunk/Build/source/texk/dvipsk/emspecial.c
===================================================================
--- trunk/Build/source/texk/dvipsk/emspecial.c	2020-12-05 04:56:57 UTC (rev 57072)
+++ trunk/Build/source/texk/dvipsk/emspecial.c	2020-12-05 05:22:50 UTC (rev 57073)
@@ -270,7 +270,7 @@
 	   }
 	}
 	else if (strncmp(emp, "message", 7) == 0) {
-           fprintf(stderr, "em message: %s\n", emp+7);
+           fprintf_str(stderr, "em message: %s\n", emp+7);
 	}
 	else if (strncmp(emp, "graph", 5) == 0) {
 	   int i;
@@ -668,7 +668,7 @@
 		fprintf(stderr,"\n");
 		prettycolumn = 0;
 	    }
-	    fprintf(stderr,"<%s",name);
+	    fprintf_str(stderr,"<%s",name);
 	    fflush(stderr);
 	    prettycolumn += 2+strlen(name);
 	    if (fullname) free (fullname);
@@ -692,7 +692,7 @@
 	  fprintf(stderr,
 	    "\nem:graph: %s width  %d pixels scaled to %.1f pixels\n",
 	    filename, wide, emwidth);
-	  fprintf(stderr,
+	  fprintf_str(stderr,
 	    "em:graph: %s height %d pixels scaled to %.1f pixels\n",
 	    filename, high, emheight);
    	}

Modified: trunk/Build/source/texk/dvipsk/finclude.c
===================================================================
--- trunk/Build/source/texk/dvipsk/finclude.c	2020-12-05 04:56:57 UTC (rev 57072)
+++ trunk/Build/source/texk/dvipsk/finclude.c	2020-12-05 05:22:50 UTC (rev 57073)
@@ -113,7 +113,7 @@
       s[--l] = 0;
    if (!ISXDIGIT(s[0]) || !ISXDIGIT(s[1]) || s[2]!=':'
          || strspn(s+3,"0123456789ABCDEFabcdef") < l-3) {
-      fprintf(stderr, "%s\n", s);
+      fprintf_str(stderr, "%s\n", s);
       error("Bad syntax in included font usage table");
       return;
    }
@@ -162,7 +162,7 @@
    name = getname(p);
    q = strtok((char *)0, " ");
    if (p==NULL || (scsize=(integer)(atof(q)*DVIperBP))==0) {
-      fprintf(stderr, "%s\n",p);
+      fprintf_str(stderr, "%s\n",p);
       error("No scaled size for included font");
       nextstring = area;   /* remove from string pool */
       return;
@@ -170,7 +170,7 @@
    scname = q;
    q = strtok((char *)0, " ");
    if (p==NULL || (dssize=(integer)(atof(q)*DVIperBP))==0) {
-      fprintf(stderr, "%s\n",p);
+      fprintf_str(stderr, "%s\n",p);
       error("No design size for included font");
       nextstring = area;
       return;
@@ -252,7 +252,7 @@
      if (1) {
 #ifdef DEBUG
        if (dd(D_FONTS))
-         fprintf(stderr,
+         fprintf_str(stderr,
 		       "Adding font '%s' from included postscript file '%s'.\n",
 		       p,psfile);
 #endif  /* DEBUG */
@@ -384,7 +384,7 @@
 
 #ifdef DEBUG
       if (dd(D_FONTS))
-         fprintf(stderr,
+         fprintf_str(stderr,
 		       "Checking for fonts in '%s'\n",filename);
 #endif  /* DEBUG */
 
@@ -418,7 +418,7 @@
      if(check_atend) {
 #ifdef DEBUG
        if (dd(D_FONTS))
-         fprintf(stderr,
+         fprintf_str(stderr,
 		       "Checking for (atend) fonts in '%s'\n",filename);
 #endif  /* DEBUG */
 
@@ -439,7 +439,7 @@
 #ifdef DEBUG
        else { /* r == NULL */
 	 if (dd(D_FONTS))
-         fprintf(stderr,
+         fprintf_str(stderr,
 		       "Did not find %%%%Trailer in included file '%s'.\n",
 		       filename);
        }

Modified: trunk/Build/source/texk/dvipsk/fontdef.c
===================================================================
--- trunk/Build/source/texk/dvipsk/fontdef.c	2020-12-05 04:56:57 UTC (rev 57072)
+++ trunk/Build/source/texk/dvipsk/fontdef.c	2020-12-05 05:22:50 UTC (rev 57073)
@@ -65,7 +65,7 @@
    fp->loadeddpi = fp->dpi;
 #ifdef DEBUG
    if (dd(D_FONTS))
-      fprintf(stderr,"Defining font (%s) %s at %.1fpt\n",
+      fprintf_str(stderr,"Defining font (%s) %s at %.1fpt\n",
          area, name, (real)scsize/(alpha*0x100000));
 #endif /* DEBUG */
    return fp;

Modified: trunk/Build/source/texk/dvipsk/header.c
===================================================================
--- trunk/Build/source/texk/dvipsk/header.c	2020-12-05 04:56:57 UTC (rev 57072)
+++ trunk/Build/source/texk/dvipsk/header.c	2020-12-05 05:22:50 UTC (rev 57073)
@@ -101,7 +101,7 @@
       (*close_file) (f);
 #ifdef DEBUG
       if (dd(D_HEADER))
-         fprintf(stderr, "Adding header file \"%s\" %ld\n",
+         fprintf_str(stderr, "Adding header file \"%s\" %ld\n",
                                 s, mem);
 #endif
       fontmem -= mem;
@@ -168,7 +168,7 @@
    while (0 != (q=get_name(&p))) {
 #ifdef DEBUG
       if (dd(D_HEADER))
-         fprintf(stderr, "Sending header file \"%s\"\n", q);
+         fprintf_str(stderr, "Sending header file \"%s\"\n", q);
 #endif
 #ifdef HPS
      if (HPS_FLAG) {

Modified: trunk/Build/source/texk/dvipsk/loadfont.c
===================================================================
--- trunk/Build/source/texk/dvipsk/loadfont.c	2020-12-05 04:56:57 UTC (rev 57072)
+++ trunk/Build/source/texk/dvipsk/loadfont.c	2020-12-05 05:22:50 UTC (rev 57073)
@@ -349,12 +349,12 @@
          fprintf(stderr, "\n");
          prettycolumn = 0;
       }
-      fprintf(stderr, "<%s>", realnameoffile);
+      fprintf_str(stderr, "<%s>", realnameoffile);
       prettycolumn += strlen(realnameoffile) + 2;
    }
 #ifdef DEBUG
    if (dd(D_FONTS))
-      fprintf(stderr,"Loading pk font %s at %.1fpt\n",
+      fprintf_str(stderr,"Loading pk font %s at %.1fpt\n",
          curfnt->name, (real)scaledsize/(alpha*0x100000));
 #endif /* DEBUG */
    if (pkbyte()!=247)

Modified: trunk/Build/source/texk/dvipsk/output.c
===================================================================
--- trunk/Build/source/texk/dvipsk/output.c	2020-12-05 04:56:57 UTC (rev 57072)
+++ trunk/Build/source/texk/dvipsk/output.c	2020-12-05 05:22:50 UTC (rev 57073)
@@ -252,7 +252,7 @@
 #if defined(VMCMS) || defined (MVSXA)
          fprintf(stderr, "<%s>", trunc_s);
 #else
-         fprintf(stderr, "<%s>", realnameoffile);
+         fprintf_str(stderr, "<%s>", realnameoffile);
 #endif
          fflush(stderr);
 #if defined(VMCMS) || defined (MVSXA)

Modified: trunk/Build/source/texk/dvipsk/pprescan.c
===================================================================
--- trunk/Build/source/texk/dvipsk/pprescan.c	2020-12-05 04:56:57 UTC (rev 57072)
+++ trunk/Build/source/texk/dvipsk/pprescan.c	2020-12-05 05:22:50 UTC (rev 57073)
@@ -134,7 +134,7 @@
                if (!noptex && mychar<0x1000000 && curfnt->kind == VF_PTEX) { /* fallback */
 #ifdef DEBUG
    if (dd(D_FONTS))
-      fprintf(stderr,
+      fprintf_str(stderr,
               "We will fallback pTeX vf:%s to %s\n",
                curfnt->name, curfnt->localfonts->desc->name);
 #endif /* DEBUG */

Modified: trunk/Build/source/texk/dvipsk/prescan.c
===================================================================
--- trunk/Build/source/texk/dvipsk/prescan.c	2020-12-05 04:56:57 UTC (rev 57072)
+++ trunk/Build/source/texk/dvipsk/prescan.c	2020-12-05 05:22:50 UTC (rev 57073)
@@ -39,10 +39,10 @@
 #ifdef MVSXA /* IBM: MVS/XA */
         for(p=preamblecomment;*p;p++) putc(ascii2ebcdic[*p], stderr);
 #else
-        for(p=preamblecomment;*p;p++) putc(*p, stderr);
+        for(p=preamblecomment;*p;p++) putc_str(*p, stderr);
 #endif  /* IBM: VM/CMS */
 #endif
-        fprintf(stderr, "' -> %s\n", oname);
+        fprintf_str(stderr, "' -> %s\n", oname);
       }
    } else
       skipover(dvibyte());

Modified: trunk/Build/source/texk/dvipsk/resident.c
===================================================================
--- trunk/Build/source/texk/dvipsk/resident.c	2020-12-05 04:56:57 UTC (rev 57072)
+++ trunk/Build/source/texk/dvipsk/resident.c	2020-12-05 05:22:50 UTC (rev 57073)
@@ -151,7 +151,7 @@
    if (p->Fontfile && downloadpspk) {
 #ifdef DEBUG
       if (dd(D_FONTS))
-         fprintf(stderr,"Using PK font %s for <%s>.\n",
+         fprintf_str(stderr,"Using PK font %s for <%s>.\n",
                                      curfnt->name, p->PSname);
 #endif  /* DEBUG */
       return 0;
@@ -161,7 +161,7 @@
  */
 #ifdef DEBUG
    if (dd(D_FONTS))
-        fprintf(stderr,"Font %s <%s> is resident.\n",
+        fprintf_str(stderr,"Font %s <%s> is resident.\n",
                                      curfnt->name, p->PSname);
 #endif  /* DEBUG */
    curfnt->resfont = p;
@@ -217,9 +217,9 @@
 static void
 bad_config(const char *err)
 {
-   fprintf (stderr, "%s:%d:", realnameoffile, c_lineno);
+   fprintf_str(stderr, "%s:%d:", realnameoffile, c_lineno);
    error (err);
-   fprintf(stderr, " (%s)\n", was_inline);
+   fprintf_str(stderr, " (%s)\n", was_inline);
 }
 

 #ifndef KPATHSEA
@@ -384,12 +384,12 @@
          fprintf(stderr, "\n");
          prettycolumn = 0;
       }
-      fprintf(stderr, "{%s}", realnameoffile);
+      fprintf_str(stderr, "{%s}", realnameoffile);
       prettycolumn += strlen(realnameoffile) + 2;
    }
 #ifdef DEBUG
      if (dd (D_CONFIG)) {
-       fprintf (stderr, "Reading dvips config file `%s':\n", realnameoffile);
+       fprintf_str(stderr, "Reading dvips config file `%s':\n", realnameoffile);
      }
 #endif
      c_lineno = 0;
@@ -397,7 +397,7 @@
        c_lineno++;
 #ifdef DEBUG
        if (dd (D_CONFIG)) {
-         fprintf (stderr, "%s:%d:%s", realnameoffile, c_lineno, was_inline);
+         fprintf_str(stderr, "%s:%d:%s", realnameoffile, c_lineno, was_inline);
        }
 #endif
 /*
@@ -727,7 +727,7 @@
          break;
 case 'z' :
 	 if (secure_option && secure && was_inline[1] == '0') {
-	   fprintf (stderr,
+	   fprintf_str(stderr,
 	            "warning: %s: z0 directive ignored since -R1 given\n",
 	            realnameoffile); /* Never happen */
          } else {
@@ -838,7 +838,7 @@
             fprintf(stderr, "\n");
             prettycolumn = 0;
          }
-         fprintf(stderr, "{%s}", realnameoffile);
+         fprintf_str(stderr, "{%s}", realnameoffile);
          prettycolumn += strlen(realnameoffile) + 2;
       }
       while (fgets(was_inline, INLINE_SIZE, deffile)!=NULL) {

Modified: trunk/Build/source/texk/dvipsk/scanpage.c
===================================================================
--- trunk/Build/source/texk/dvipsk/scanpage.c	2020-12-05 04:56:57 UTC (rev 57072)
+++ trunk/Build/source/texk/dvipsk/scanpage.c	2020-12-05 05:22:50 UTC (rev 57073)
@@ -214,7 +214,7 @@
                if (!noptex && mychar<0x1000000 && curfnt->kind == VF_PTEX) { /* fallback */
 #ifdef DEBUG
    if (dd(D_FONTS))
-      fprintf(stderr,
+      fprintf_str(stderr,
               "We will fallback pTeX vf:%s to %s\n",
                curfnt->name, curfnt->localfonts->desc->name);
 #endif /* DEBUG */

Modified: trunk/Build/source/texk/dvipsk/search.c
===================================================================
--- trunk/Build/source/texk/dvipsk/search.c	2020-12-05 04:56:57 UTC (rev 57072)
+++ trunk/Build/source/texk/dvipsk/search.c	2020-12-05 05:22:50 UTC (rev 57073)
@@ -28,8 +28,20 @@
 #define fopen(file, fmode)  generic_fsyscp_fopen(file, fmode)
 #define popen(pcmd, pmode)  fsyscp_popen(pcmd, pmode)
 #define pclose(pstream) _pclose(pstream)
+
+#undef FATAL_PERROR
+#if defined (KPSE_COMPAT_API)
+#define FATAL_PERROR(str) do { \
+  win32_fprintf (stderr, "%s: ", kpse_def->invocation_name); \
+  win32_perror (str); exit (EXIT_FAILURE); } while (0)
+#else
+/* If there is no global variable available, just output the error */
+#define FATAL_PERROR(str) do { \
+  win32_perror (str); exit (EXIT_FAILURE); } while (0)
 #endif
 
+#endif
+
 #ifndef GUNZIP
 #define GUNZIP          "gzip -d"
 #endif
@@ -173,7 +185,7 @@
       cmd = concat3 (prog, " -c ", quoted_name);
       ret = popen (cmd, "r");
       if (dd(D_FILES)) {
-        fprintf(stderr, "popen(%s) %s\n", cmd,
+        fprintf_str(stderr, "popen(%s) %s\n", cmd,
                          ret == NULL ? "failed" : "succeeded");
       }
       SET_BINARY(fileno(ret));
@@ -246,7 +258,7 @@
 {
    FILE *tf;
    if (dd(D_FILES)) {
-      fprintf(stderr, "<%s(%s)> ", n, t);
+      fprintf_str(stderr, "<%s(%s)> ", n, t);
       tf = fopen(n, t);
       if (tf == 0)
          fprintf(stderr, "failed\n");
@@ -320,7 +332,7 @@
       strcpy(np,nbuf);
       /* now code copied from my_real_fopen() */
       if (dd(D_FILES)) {
-         fprintf(stderr, "<%s(%s)> ", n, t);
+         fprintf_str(stderr, "<%s(%s)> ", n, t);
          tf = fopen(n, t);
          if (tf == 0)
             fprintf(stderr, "failed\n");

Modified: trunk/Build/source/texk/dvipsk/t1part.c
===================================================================
--- trunk/Build/source/texk/dvipsk/t1part.c	2020-12-05 04:56:57 UTC (rev 57072)
+++ trunk/Build/source/texk/dvipsk/t1part.c	2020-12-05 05:22:50 UTC (rev 57073)
@@ -654,7 +654,7 @@
     {
         if(ThisChar->choose==1)
         {
-            fprintf(stderr, " Debug: Char %d '%s'\n",
+            fprintf_str(stderr, " Debug: Char %d '%s'\n",
                     ThisChar->num,ThisChar->name);
         }
         ThisChar = ThisChar->NextChar;
@@ -1020,7 +1020,7 @@
             {
                 if(TableCommand[k].code==*pstack)
                 {
-                    fprintf(stderr," %s",
+                    fprintf_str(stderr," %s",
                     TableCommand[k].command);
                     k=0;
                     break;
@@ -1134,7 +1134,7 @@
         {
             byte = CDeCrypt(*loc++, &loccr);
             if (byte > MAX_ESCAPE)
-                fprintf(stderr,
+                fprintf_str(stderr,
             "Error: not_defined_e%d in %s", byte, psfontfile);
             else
             {
@@ -1357,7 +1357,7 @@
 
                         if(dd(D_VIEW_VECTOR)&&(num_err==-1))
                         {
-                            fprintf(stderr,
+                            fprintf_str(stderr,
                          " Debug: Char '%s' not used in WorkVector\n", token);
 
                         }
@@ -1405,7 +1405,7 @@
                         if(dd(D_CALL_SUBR))
                         {
                             if(num_err>0)
-                                fprintf(stderr,
+                                fprintf_str(stderr,
                             " Debug for Char '%s'\n", tmp_token);
                         }
 #endif
@@ -1419,7 +1419,7 @@
                 if(num_err<0)
                 {
                     ErrorOfScan(num_err);
-                    fprintf(stderr,"in Char string of '%s'", tmp_token);
+                    fprintf_str(stderr,"in Char string of '%s'", tmp_token);
                     exit(1);
                 }
                 number++;
@@ -1427,7 +1427,7 @@
         }
         else
         {
-            fprintf(stderr,
+            fprintf_str(stderr,
            "\n File <%s> ended before all chars have been found.", psfontfile);
 
             fprintf(stderr,
@@ -1437,7 +1437,7 @@
 
             if(tmp_token!=NULL)
             {
-                fprintf(stderr, "\n Last seen token was '%s'\n", tmp_token);
+                fprintf_str(stderr, "\n Last seen token was '%s'\n", tmp_token);
             }
             exit(1);
         }
@@ -1511,7 +1511,7 @@
                         tmp_num = GetNum();
                         if(tmp_num<0)
                         {
-                            fprintf(stderr,
+                            fprintf_str(stderr,
                             "\n ERROR: Number not found for '%s' in <%s>",
                             Key[i].name, psfontfile);
                             exit(1);
@@ -1526,11 +1526,11 @@
         }
         else
         {
-            fprintf(stderr,
+            fprintf_str(stderr,
             "\n ERROR: In <%s> keyword not found:", psfontfile);
 
             for(i=First_Key; i<=lastkey; i++)
-                fprintf(stderr,"\n %dth > '%s' ",i,Key[i].name);
+                fprintf_str(stderr,"\n %dth > '%s' ",i,Key[i].name);
             exit(1);
         }
     }
@@ -1586,7 +1586,7 @@
                     for(i=0;i<=2;i++)
                     {
                         if(keyword[i].oldnum!=0)
-                            fprintf(stderr, " Result for <%s>:  %s  %d (instead %d) \n",
+                            fprintf_str(stderr, " Result for <%s>:  %s  %d (instead %d) \n",
                             psfontfile, Key[keyword[i].type].name,keyword[i].newnum, keyword[i].oldnum);
                     }
 
@@ -1864,7 +1864,7 @@
         if(num_err<0)
         {
             ErrorOfScan(num_err);
-            fprintf(stderr,
+            fprintf_str(stderr,
             "\n ERROR in encoding vector in <%s>",  psfontfile);
             exit(1);
         }
@@ -1894,7 +1894,7 @@
         }
         else
         {
-            fprintf(stderr,
+            fprintf_str(stderr,
             "WARNING: '/Encoding' not found in <%s>\n", psfontfile);
             exit(1);
         }
@@ -1926,7 +1926,7 @@
             fprintf(stderr,
             "\n Warning: after loading AFM file \n");
 
-            fprintf(stderr,
+            fprintf_str(stderr,
             " only %d chars found instead %d for <%s>\n",
             CharCount, GridCount, psfontfile);
         }
@@ -1945,7 +1945,7 @@
             fprintf(stderr, " Encoding: not standard \n");
 
         if(reencode==FLG_REENCODE)
-            fprintf(stderr, " with reencode vector <%s>\n", psvectfile);
+            fprintf_str(stderr, " with reencode vector <%s>\n", psvectfile);
 
         PrintChar(FirstCharW);
     }
@@ -2396,7 +2396,7 @@
 
     afmfile[i]='\0';
     strcat((char *) afmfile,".afm");
-    fprintf(stderr, "<%s>", afmfile);
+    fprintf_str(stderr, "<%s>", afmfile);
 
     if ((fafm = psfopen((char *) afmfile, "r")) == NULL)
     {
@@ -2490,7 +2490,7 @@
 
 #ifdef DEBUG
         if(dd(D_VIEW_VECTOR))
-           fprintf(stderr, " Base vector <%s>.", basevect);
+           fprintf_str(stderr, " Base vector <%s>.", basevect);
 #endif
 
         if(LoadVector(1, FirstCharB)==1)
@@ -2524,7 +2524,7 @@
             if (rc == FALSE)
             {
                 NameOfProgram();
-                (void) fprintf(stderr,
+                (void) fprintf_str(stderr,
                 "Error: %s is not a valid PFA file\n", fontfile);
                 return -1;
             }
@@ -2541,7 +2541,7 @@
             if (rc==FALSE)
             {
                 NameOfProgram();
-                (void) fprintf(stderr,
+                (void) fprintf_str(stderr,
                 "Error: %s is not a valid PFB file\n", fontfile);
                 return -1;
             }
@@ -2548,7 +2548,7 @@
             break;
         case -1:
             NameOfProgram();
-            fprintf(stderr,
+            fprintf_str(stderr,
             "Error: %s has neither PFA nor PFB extension", fontfile);
             return -1;
     }
@@ -2621,7 +2621,7 @@
                             CharCount++;
                         else
                         {
-                           fprintf(stderr,
+                           fprintf_str(stderr,
                "Error: '%s' not found in reencoding vector <%s> for <%s>\n",
                              token,psvectfile, psfontfile);
                         }
@@ -2654,7 +2654,7 @@
         if((index_grid!=256)&&(CharCount!=256))
         {
             fclose(fvect);
-            fprintf(stderr,"Error during Load Vector in <%s>  \n",
+            fprintf_str(stderr,"Error during Load Vector in <%s>  \n",
             psvectfile);
             fprintf(stderr,
                     "Found %d chars instead 256\n", max(index_grid,CharCount));
@@ -2669,7 +2669,7 @@
         else
         {
             fclose(fvect);
-            fprintf(stderr,
+            fprintf_str(stderr,
                      "\n Warning: Vector from <%s> for <%s> doesn't load\n",
             psvectfile, psfontfile);
             return -1;
@@ -2677,7 +2677,7 @@
     }
     else
     {
-        fprintf(stderr,"\n Error: ending token 'def' not found in <%s> \n",
+        fprintf_str(stderr,"\n Error: ending token 'def' not found in <%s> \n",
         psvectfile);
         return -2;
     }

Modified: trunk/Build/source/texk/dvipsk/virtualfont.c
===================================================================
--- trunk/Build/source/texk/dvipsk/virtualfont.c	2020-12-05 04:56:57 UTC (rev 57072)
+++ trunk/Build/source/texk/dvipsk/virtualfont.c	2020-12-05 05:22:50 UTC (rev 57073)
@@ -166,7 +166,7 @@
       return (0);
 #ifdef DEBUG
    if (dd(D_FONTS))
-      fprintf(stderr,"Loading virtual font %s at %.1fpt\n",
+      fprintf_str(stderr,"Loading virtual font %s at %.1fpt\n",
          name, (real)scaledsize/(alpha*0x100000));
 #endif /* DEBUG */
 

Modified: trunk/Build/source/texk/dvipsk/writet1.c
===================================================================
--- trunk/Build/source/texk/dvipsk/writet1.c	2020-12-05 04:56:57 UTC (rev 57072)
+++ trunk/Build/source/texk/dvipsk/writet1.c	2020-12-05 05:22:50 UTC (rev 57073)
@@ -265,10 +265,10 @@
     va_start(args, fmt);
     fputs("\nError: module writet1", stderr);
     if (cur_file_name)
-        fprintf(stderr, " (file %s)", cur_file_name);
+        fprintf_str(stderr, " (file %s)", cur_file_name);
     fputs(": ", stderr);
     vsprintf(print_buf, fmt, args);
-    fputs(print_buf, stderr);
+    fputs_str(print_buf, stderr);
     fputs("\n ==> Fatal error occurred, the output PS file is not finished!\n", stderr);
     va_end(args);
     exit(-1);
@@ -280,10 +280,10 @@
     va_start(args, fmt);
     fputs("\nWarning: module writet1 of dvips", stderr);
     if (cur_file_name)
-        fprintf(stderr, " (file %s)", cur_file_name);
+        fprintf_str(stderr, " (file %s)", cur_file_name);
     fputs(": ", stderr);
     vsprintf(print_buf, fmt, args);
-    fputs(print_buf, stderr);
+    fputs_str(print_buf, stderr);
     fputs("\n", stderr);
     va_end(args);
 }



More information about the tex-live-commits mailing list.