texlive[62514] Build/source/texk/web2c/lib: texmfmp.c: Convert

commits+hironobu at tug.org commits+hironobu at tug.org
Tue Mar 8 13:25:05 CET 2022


Revision: 62514
          http://tug.org/svn/texlive?view=revision&revision=62514
Author:   hironobu
Date:     2022-03-08 13:25:05 +0100 (Tue, 08 Mar 2022)
Log Message:
-----------
texmfmp.c: Convert filename to utf8 in find_input_file for pTeX (H. Kitagawa)

Modified Paths:
--------------
    trunk/Build/source/texk/web2c/lib/ChangeLog
    trunk/Build/source/texk/web2c/lib/texmfmp.c

Modified: trunk/Build/source/texk/web2c/lib/ChangeLog
===================================================================
--- trunk/Build/source/texk/web2c/lib/ChangeLog	2022-03-08 05:19:24 UTC (rev 62513)
+++ trunk/Build/source/texk/web2c/lib/ChangeLog	2022-03-08 12:25:05 UTC (rev 62514)
@@ -1,3 +1,8 @@
+2022-03-08  Hironori Kitagawa  <h_kitagawa2001 at yahoo.co.jp>
+
+	* texmfmp.c: Convert filename to utf8 in find_input_file for pTeX.
+	  https://github.com/texjporg/tex-jp-build/issues/45
+
 2022-03-03  Hironori Kitagawa  <h_kitagawa2001 at yahoo.co.jp>
 
 	* texmfmp.c: Convert the argument of runpopen to utf8 for pTeX.

Modified: trunk/Build/source/texk/web2c/lib/texmfmp.c
===================================================================
--- trunk/Build/source/texk/web2c/lib/texmfmp.c	2022-03-08 05:19:24 UTC (rev 62513)
+++ trunk/Build/source/texk/web2c/lib/texmfmp.c	2022-03-08 12:25:05 UTC (rev 62514)
@@ -3398,12 +3398,20 @@
 find_input_file(integer s)
 {
     string filename;
-
+#if IS_pTeX && !defined(WIN32)
+    string fname0; string fname1 = NULL;
+#endif
 #if defined(XeTeX)
     filename = gettexstring(s);
 #else
     filename = makecfilename(s);
 #endif
+#if IS_pTeX && !defined(WIN32)
+   fname0 = ptenc_from_internal_enc_string_to_utf8(filename);
+   if (fname0) {
+       fname1 = filename; filename = fname0;
+   }
+#endif
     /* Look in -output-directory first, if the filename is not
        absolute.  This is because we want the pdf* functions to
        be able to find the same files as \openin */
@@ -3412,14 +3420,26 @@
 
         pathname = concat3(output_directory, DIR_SEP_STRING, filename);
         if (!access(pathname, R_OK) && !dir_p (pathname)) {
+#if IS_pTeX && !defined(WIN32)
+            if (fname1) free(filename);
+#endif
             return pathname;
         }
         xfree (pathname);
     }
     if (! kpse_in_name_ok(filename)) {
+#if IS_pTeX && !defined(WIN32)
+       if (fname1) free(filename);
+#endif
        return NULL;                /* no permission */
     }
+#if IS_pTeX && !defined(WIN32)
+    fname0 = kpse_find_tex(filename);
+    if (fname1) free(filename);
+    return fname0;
+#else
     return kpse_find_tex(filename);
+#endif
 }
 
 #if !defined(XeTeX)



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