summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTakuji Tanaka <ttk@t-lab.opal.ne.jp>2020-12-05 05:22:50 +0000
committerTakuji Tanaka <ttk@t-lab.opal.ne.jp>2020-12-05 05:22:50 +0000
commitf6d1cb1a3a1cec3307c3179cf58dd0694354a61d (patch)
treed5e97726a3141400aa64d2007b9e276eef26829f
parentfdfd72a0140c77f696caca8485d4ac50968f822c (diff)
texk/dvipsk: Allow Unicode error messages on Windows console. (Windows only)
git-svn-id: svn://tug.org/texlive/trunk@57073 c570f23f-e606-0410-a88d-b1316a301751
-rw-r--r--Build/source/texk/dvipsk/ChangeLog4
-rw-r--r--Build/source/texk/dvipsk/bitmapenc.c4
-rw-r--r--Build/source/texk/dvipsk/color.c4
-rw-r--r--Build/source/texk/dvipsk/dopage.c2
-rw-r--r--Build/source/texk/dvipsk/dospecial.c4
-rw-r--r--Build/source/texk/dvipsk/download.c2
-rw-r--r--Build/source/texk/dvipsk/dvips.c16
-rw-r--r--Build/source/texk/dvipsk/dvips.h13
-rw-r--r--Build/source/texk/dvipsk/emspecial.c6
-rw-r--r--Build/source/texk/dvipsk/finclude.c14
-rw-r--r--Build/source/texk/dvipsk/fontdef.c2
-rw-r--r--Build/source/texk/dvipsk/header.c4
-rw-r--r--Build/source/texk/dvipsk/loadfont.c4
-rw-r--r--Build/source/texk/dvipsk/output.c2
-rw-r--r--Build/source/texk/dvipsk/pprescan.c2
-rw-r--r--Build/source/texk/dvipsk/prescan.c4
-rw-r--r--Build/source/texk/dvipsk/resident.c18
-rw-r--r--Build/source/texk/dvipsk/scanpage.c2
-rw-r--r--Build/source/texk/dvipsk/search.c18
-rw-r--r--Build/source/texk/dvipsk/t1part.c50
-rw-r--r--Build/source/texk/dvipsk/virtualfont.c2
-rw-r--r--Build/source/texk/dvipsk/writet1.c8
22 files changed, 107 insertions, 78 deletions
diff --git a/Build/source/texk/dvipsk/ChangeLog b/Build/source/texk/dvipsk/ChangeLog
index 58086bddc24..f767063cbfb 100644
--- a/Build/source/texk/dvipsk/ChangeLog
+++ b/Build/source/texk/dvipsk/ChangeLog
@@ -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@w32tex.org>
diff --git a/Build/source/texk/dvipsk/bitmapenc.c b/Build/source/texk/dvipsk/bitmapenc.c
index 64ff881c848..ef2d868bc9c 100644
--- a/Build/source/texk/dvipsk/bitmapenc.c
+++ b/Build/source/texk/dvipsk/bitmapenc.c
@@ -493,7 +493,7 @@ int downloadbmencoding(const char *name, double scale, fontdesctype *curfnt) {
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 int warned_about_missing_encoding = 0 ;
*/
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) ;
}
diff --git a/Build/source/texk/dvipsk/color.c b/Build/source/texk/dvipsk/color.c
index 3db791f528c..3366f00b390 100644
--- a/Build/source/texk/dvipsk/color.c
+++ b/Build/source/texk/dvipsk/color.c
@@ -180,11 +180,11 @@ resetcolorstack(char * p, int outtops)
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 */
}
diff --git a/Build/source/texk/dvipsk/dopage.c b/Build/source/texk/dvipsk/dopage.c
index 237ea106eb7..5519b76e35f 100644
--- a/Build/source/texk/dvipsk/dopage.c
+++ b/Build/source/texk/dvipsk/dopage.c
@@ -136,7 +136,7 @@ dochar:
/* 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 */
diff --git a/Build/source/texk/dvipsk/dospecial.c b/Build/source/texk/dvipsk/dospecial.c
index eb8ce1ac186..33d3a1cc23e 100644
--- a/Build/source/texk/dvipsk/dospecial.c
+++ b/Build/source/texk/dvipsk/dospecial.c
@@ -400,7 +400,7 @@ predospecial(integer numbytes, Boolean scanning)
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 @@ if (HPS_FLAG && NEED_NEW_BOX) {
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) {
diff --git a/Build/source/texk/dvipsk/download.c b/Build/source/texk/dvipsk/download.c
index 37b86c7eab9..54718ce2adf 100644
--- a/Build/source/texk/dvipsk/download.c
+++ b/Build/source/texk/dvipsk/download.c
@@ -537,7 +537,7 @@ downpsfont(charusetype *p, charusetype *all)
fprintf(stderr, "\n");
prettycolumn = 0;
}
- fprintf(stderr, "<%s>", realnameoffile);
+ fprintf_str(stderr, "<%s>", realnameoffile);
prettycolumn += strlen(realnameoffile) + 2;
}
if (! disablecomments)
diff --git a/Build/source/texk/dvipsk/dvips.c b/Build/source/texk/dvipsk/dvips.c
index a7c4c3587b1..6971edf813e 100644
--- a/Build/source/texk/dvipsk/dvips.c
+++ b/Build/source/texk/dvipsk/dvips.c
@@ -367,7 +367,7 @@ error_with_perror(const char *s, const char *fname)
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 @@ default:
#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 @@ default:
fprintf(stderr, "\n");
prettycolumn = 0;
}
- fprintf(stderr, "(-> %s) ", oname);
+ fprintf_str(stderr, "(-> %s) ", oname);
prettycolumn += strlen(oname) + 6;
}
#ifdef HPS
diff --git a/Build/source/texk/dvipsk/dvips.h b/Build/source/texk/dvipsk/dvips.h
index a0a47797a7e..276efbe0380 100644
--- a/Build/source/texk/dvipsk/dvips.h
+++ b/Build/source/texk/dvipsk/dvips.h
@@ -310,6 +310,19 @@ struct papsiz {
#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)
diff --git a/Build/source/texk/dvipsk/emspecial.c b/Build/source/texk/dvipsk/emspecial.c
index f25b1eb5a1c..38e450d050e 100644
--- a/Build/source/texk/dvipsk/emspecial.c
+++ b/Build/source/texk/dvipsk/emspecial.c
@@ -270,7 +270,7 @@ char *emp;
}
}
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 @@ imagehead(char *filename, int wide, int high,
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 @@ imagehead(char *filename, int wide, int high,
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);
}
diff --git a/Build/source/texk/dvipsk/finclude.c b/Build/source/texk/dvipsk/finclude.c
index bdf62bbc17c..1f38aec0f1c 100644
--- a/Build/source/texk/dvipsk/finclude.c
+++ b/Build/source/texk/dvipsk/finclude.c
@@ -113,7 +113,7 @@ includechars(fontdesctype *f, char *s)
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 @@ scan1fontcomment(char *p)
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 @@ scan1fontcomment(char *p)
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 @@ scan_fontnames(char *str, const char *psfile)
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 @@ scanfontcomments(const char *filename)
#ifdef DEBUG
if (dd(D_FONTS))
- fprintf(stderr,
+ fprintf_str(stderr,
"Checking for fonts in '%s'\n",filename);
#endif /* DEBUG */
@@ -418,7 +418,7 @@ scanfontcomments(const char *filename)
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 @@ scanfontcomments(const char *filename)
#ifdef DEBUG
else { /* r == NULL */
if (dd(D_FONTS))
- fprintf(stderr,
+ fprintf_str(stderr,
"Did not find %%%%Trailer in included file '%s'.\n",
filename);
}
diff --git a/Build/source/texk/dvipsk/fontdef.c b/Build/source/texk/dvipsk/fontdef.c
index 466c2d4aacf..dc27304a47f 100644
--- a/Build/source/texk/dvipsk/fontdef.c
+++ b/Build/source/texk/dvipsk/fontdef.c
@@ -65,7 +65,7 @@ newfontdesc(integer cksum, integer scsize, integer dssize,
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;
diff --git a/Build/source/texk/dvipsk/header.c b/Build/source/texk/dvipsk/header.c
index 771041db2d4..31b03e3be18 100644
--- a/Build/source/texk/dvipsk/header.c
+++ b/Build/source/texk/dvipsk/header.c
@@ -101,7 +101,7 @@ checkhmem(const char *s, char *pre, char *post)
(*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 @@ send_headers(void) {
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) {
diff --git a/Build/source/texk/dvipsk/loadfont.c b/Build/source/texk/dvipsk/loadfont.c
index a9e1b14260d..f6d151dfd17 100644
--- a/Build/source/texk/dvipsk/loadfont.c
+++ b/Build/source/texk/dvipsk/loadfont.c
@@ -349,12 +349,12 @@ loadfont(register fontdesctype *curfnt)
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)
diff --git a/Build/source/texk/dvipsk/output.c b/Build/source/texk/dvipsk/output.c
index 632e5910ee1..650323a372c 100644
--- a/Build/source/texk/dvipsk/output.c
+++ b/Build/source/texk/dvipsk/output.c
@@ -252,7 +252,7 @@ copyfile_general(const char *s, struct header_list *cur_header)
#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)
diff --git a/Build/source/texk/dvipsk/pprescan.c b/Build/source/texk/dvipsk/pprescan.c
index 665e40c7998..b434a93fac1 100644
--- a/Build/source/texk/dvipsk/pprescan.c
+++ b/Build/source/texk/dvipsk/pprescan.c
@@ -134,7 +134,7 @@ dochar:
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 */
diff --git a/Build/source/texk/dvipsk/prescan.c b/Build/source/texk/dvipsk/prescan.c
index 3dd2b20b9e6..bde97ef2531 100644
--- a/Build/source/texk/dvipsk/prescan.c
+++ b/Build/source/texk/dvipsk/prescan.c
@@ -39,10 +39,10 @@ readpreamble(void)
#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());
diff --git a/Build/source/texk/dvipsk/resident.c b/Build/source/texk/dvipsk/resident.c
index 10df9d6de33..8a9a04fc972 100644
--- a/Build/source/texk/dvipsk/resident.c
+++ b/Build/source/texk/dvipsk/resident.c
@@ -151,7 +151,7 @@ residentfont(register fontdesctype *curfnt)
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 @@ residentfont(register fontdesctype *curfnt)
*/
#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 unsigned c_lineno;
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 @@ getdefaults(const char *s)
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 @@ getdefaults(const char *s)
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 @@ case 'e' :
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 @@ getpsinfo(const char *name)
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) {
diff --git a/Build/source/texk/dvipsk/scanpage.c b/Build/source/texk/dvipsk/scanpage.c
index b970de2a6b9..51ad3afb9c7 100644
--- a/Build/source/texk/dvipsk/scanpage.c
+++ b/Build/source/texk/dvipsk/scanpage.c
@@ -214,7 +214,7 @@ dochar:
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 */
diff --git a/Build/source/texk/dvipsk/search.c b/Build/source/texk/dvipsk/search.c
index c3e6123b79c..ca6b3cda6a6 100644
--- a/Build/source/texk/dvipsk/search.c
+++ b/Build/source/texk/dvipsk/search.c
@@ -28,6 +28,18 @@ extern FILE *generic_fsyscp_fopen(const char *name, const char *mode);
#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
@@ -173,7 +185,7 @@ search(kpse_file_format_type format, const char *file, const char *mode)
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 @@ my_real_fopen(register const char *n, register const char *t)
{
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 @@ fat_fopen(char *fname, char *t)
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");
diff --git a/Build/source/texk/dvipsk/t1part.c b/Build/source/texk/dvipsk/t1part.c
index 9d43e22c2cd..6b867940c36 100644
--- a/Build/source/texk/dvipsk/t1part.c
+++ b/Build/source/texk/dvipsk/t1part.c
@@ -654,7 +654,7 @@ PrintChar(CHAR *TmpChar)
{
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 @@ ViewReturnCall(int num_err, int top, int *pstack,
{
if(TableCommand[k].code==*pstack)
{
- fprintf(stderr," %s",
+ fprintf_str(stderr," %s",
TableCommand[k].command);
k=0;
break;
@@ -1134,7 +1134,7 @@ DeCodeStr(int num, int numseac)
{
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 @@ ScanChars(int i)
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 @@ ScanChars(int i)
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 @@ ScanChars(int i)
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 @@ ScanChars(int i)
}
else
{
- fprintf(stderr,
+ fprintf_str(stderr,
"\n File <%s> ended before all chars have been found.", psfontfile);
fprintf(stderr,
@@ -1437,7 +1437,7 @@ ScanChars(int i)
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 @@ FindKeyWord(int First_Key, int lastkey)
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 @@ FindKeyWord(int First_Key, int lastkey)
}
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 @@ ScanBinary(void)
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 @@ FindEncoding(void)
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 @@ CheckChoosing(void)
}
else
{
- fprintf(stderr,
+ fprintf_str(stderr,
"WARNING: '/Encoding' not found in <%s>\n", psfontfile);
exit(1);
}
@@ -1926,7 +1926,7 @@ CheckChoosing(void)
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 @@ CheckChoosing(void)
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 @@ Afm(void)
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 @@ FontPart(FILE *fout, unsigned char *fontfile,
#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 @@ FontPart(FILE *fout, unsigned char *fontfile,
if (rc == FALSE)
{
NameOfProgram();
- (void) fprintf(stderr,
+ (void) fprintf_str(stderr,
"Error: %s is not a valid PFA file\n", fontfile);
return -1;
}
@@ -2541,14 +2541,14 @@ FontPart(FILE *fout, unsigned char *fontfile,
if (rc==FALSE)
{
NameOfProgram();
- (void) fprintf(stderr,
+ (void) fprintf_str(stderr,
"Error: %s is not a valid PFB file\n", fontfile);
return -1;
}
break;
case -1:
NameOfProgram();
- fprintf(stderr,
+ fprintf_str(stderr,
"Error: %s has neither PFA nor PFB extension", fontfile);
return -1;
}
@@ -2621,7 +2621,7 @@ LoadVector(int num, CHAR *TmpChar)
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 @@ LoadVector(int num, CHAR *TmpChar)
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 @@ LoadVector(int num, CHAR *TmpChar)
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 @@ LoadVector(int num, CHAR *TmpChar)
}
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;
}
diff --git a/Build/source/texk/dvipsk/virtualfont.c b/Build/source/texk/dvipsk/virtualfont.c
index 9675a3e467e..287be596609 100644
--- a/Build/source/texk/dvipsk/virtualfont.c
+++ b/Build/source/texk/dvipsk/virtualfont.c
@@ -166,7 +166,7 @@ virtualfont(register fontdesctype *curfnt)
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 */
diff --git a/Build/source/texk/dvipsk/writet1.c b/Build/source/texk/dvipsk/writet1.c
index 73c03018c49..0a95247196f 100644
--- a/Build/source/texk/dvipsk/writet1.c
+++ b/Build/source/texk/dvipsk/writet1.c
@@ -265,10 +265,10 @@ static void pdftex_fail(const char *fmt, ...)
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 @@ static void pdftex_warn(const char *fmt, ...)
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);
}