texlive[50954] Build/source/texk/dvipsk: support file names always in

commits+kakuto at tug.org commits+kakuto at tug.org
Fri May 3 01:25:35 CEST 2019


Revision: 50954
          http://tug.org/svn/texlive?view=revision&revision=50954
Author:   kakuto
Date:     2019-05-03 01:25:34 +0200 (Fri, 03 May 2019)
Log Message:
-----------
support file names always in default CP of OS (Windows only)

Modified Paths:
--------------
    trunk/Build/source/texk/dvipsk/ChangeLog
    trunk/Build/source/texk/dvipsk/dvips.c
    trunk/Build/source/texk/dvipsk/output.c
    trunk/Build/source/texk/dvipsk/search.c

Modified: trunk/Build/source/texk/dvipsk/ChangeLog
===================================================================
--- trunk/Build/source/texk/dvipsk/ChangeLog	2019-05-02 23:09:47 UTC (rev 50953)
+++ trunk/Build/source/texk/dvipsk/ChangeLog	2019-05-02 23:25:34 UTC (rev 50954)
@@ -1,3 +1,9 @@
+2019-05-03  Akira Kakuto  <kakuto at w32tex.org>
+
+	* dvips.c, output.c, search.c: Support non-ascii file names
+	in default code page of OS irrespective of values of a
+	variable 'command_line_encoding' (Windows only).
+
 2019-04-30  Karl Berry  <karl at tug.org>
 
 	* dosection.c (dosection): close PostScript string constant

Modified: trunk/Build/source/texk/dvipsk/dvips.c
===================================================================
--- trunk/Build/source/texk/dvipsk/dvips.c	2019-05-02 23:09:47 UTC (rev 50953)
+++ trunk/Build/source/texk/dvipsk/dvips.c	2019-05-02 23:25:34 UTC (rev 50954)
@@ -49,8 +49,23 @@
 #endif
 
 #if defined(WIN32) && defined(KPATHSEA)
+FILE *generic_fsyscp_fopen(const char *filename, const char *mode)
+{
+  FILE *f;
+
+  f = fsyscp_fopen (filename, mode);
+
+  if (f == NULL && file_system_codepage != win32_codepage) {
+    int tmpcp = file_system_codepage;
+    file_system_codepage = win32_codepage;
+    f = fsyscp_fopen (filename, mode);
+    file_system_codepage = tmpcp;
+  }
+
+  return f;
+}
 #undef fopen
-#define fopen(file, fmode)  fsyscp_fopen(file, fmode)
+#define fopen(file, fmode)  generic_fsyscp_fopen(file, fmode)
 #endif
 
 #ifndef DEFRES

Modified: trunk/Build/source/texk/dvipsk/output.c
===================================================================
--- trunk/Build/source/texk/dvipsk/output.c	2019-05-02 23:09:47 UTC (rev 50953)
+++ trunk/Build/source/texk/dvipsk/output.c	2019-05-02 23:25:34 UTC (rev 50954)
@@ -20,7 +20,8 @@
 #undef fopen
 #undef popen
 #undef pclose
-#define fopen(file, fmode)  fsyscp_fopen(file, fmode)
+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)
 #endif
@@ -157,6 +158,14 @@
  *   or figure files to be installed in the .../ps directory.
  */
       f = search(figpath, s, READBIN);
+#if defined(WIN32)
+      if (f == 0 && file_system_codepage != win32_codepage) {
+         int tmpcp = file_system_codepage;
+         file_system_codepage = win32_codepage;
+         f = search(figpath, s, READBIN);
+         file_system_codepage = tmpcp;
+      }
+#endif
       if (f == 0)
          f = search(headerpath, s, READBIN);
 #if defined(VMCMS) || defined (MVSXA)

Modified: trunk/Build/source/texk/dvipsk/search.c
===================================================================
--- trunk/Build/source/texk/dvipsk/search.c	2019-05-02 23:09:47 UTC (rev 50953)
+++ trunk/Build/source/texk/dvipsk/search.c	2019-05-02 23:25:34 UTC (rev 50954)
@@ -24,7 +24,8 @@
 #undef fopen
 #undef popen
 #undef pclose
-#define fopen(file, fmode)  fsyscp_fopen(file, fmode)
+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)
 #endif



More information about the tex-live-commits mailing list