texlive[75028] Build/source/texk/web2c: ptex: Convert recorder

commits+takuji at tug.org commits+takuji at tug.org
Sat Apr 26 15:43:08 CEST 2025


Revision: 75028
          https://tug.org/svn/texlive?view=revision&revision=75028
Author:   takuji
Date:     2025-04-26 15:43:08 +0200 (Sat, 26 Apr 2025)
Log Message:
-----------
ptex: Convert recorder filename to UTF-8

Modified Paths:
--------------
    trunk/Build/source/texk/web2c/euptexdir/ChangeLog
    trunk/Build/source/texk/web2c/euptexdir/wcfname0.test
    trunk/Build/source/texk/web2c/lib/ChangeLog
    trunk/Build/source/texk/web2c/lib/openclose.c
    trunk/Build/source/texk/web2c/ptexdir/ChangeLog
    trunk/Build/source/texk/web2c/ptexdir/wcfname.test
    trunk/Build/source/texk/web2c/uptexdir/ChangeLog
    trunk/Build/source/texk/web2c/uptexdir/wcfname0.test

Modified: trunk/Build/source/texk/web2c/euptexdir/ChangeLog
===================================================================
--- trunk/Build/source/texk/web2c/euptexdir/ChangeLog	2025-04-26 10:02:06 UTC (rev 75027)
+++ trunk/Build/source/texk/web2c/euptexdir/ChangeLog	2025-04-26 13:43:08 UTC (rev 75028)
@@ -6,6 +6,9 @@
 	tests/eup-jctrlsyma-{e,u}.typ,
 	tests/eup-jchwidow{,-{e,s}}.log, am/euptex.am:
 	Clean up tests to prepare to remove ptexdir.
+	https://github.com/texjporg/tex-jp-build/issues/32
+	* wcfname0.test: Add tests for recorder filename.
+	https://github.com/texjporg/tex-jp-build/issues/45
 
 2025-04-05  TANAKA Takuji  <ttk at t-lab.opal.ne.jp>
 

Modified: trunk/Build/source/texk/web2c/euptexdir/wcfname0.test
===================================================================
--- trunk/Build/source/texk/web2c/euptexdir/wcfname0.test	2025-04-26 10:02:06 UTC (rev 75027)
+++ trunk/Build/source/texk/web2c/euptexdir/wcfname0.test	2025-04-26 13:43:08 UTC (rev 75028)
@@ -1,6 +1,6 @@
 #! /bin/sh -vx
 #
-# Copyright 2022-2023 Japanese TeX Development Community <issue at texjp.org>
+# Copyright 2022-2025 Japanese TeX Development Community <issue at texjp.org>
 # You may freely use, modify and/or distribute this file.
 
 engine=euptex
@@ -83,7 +83,7 @@
       { rc=1 ; err1=$err1" $fenc:$ienc:$doc" ; }
   $_kpsewhich -progname=$engine $doc-tmp.tex || rc=12
   mv $job.txt $job.log $testdir/ || rc=14
-  mv $job.fls $testdir/ || : echo "FIXME" # check *.fls
+  mv $job.fls $testdir/ || rc=15
   diff $testdir/$job.txt $srcdir/tests/fn-$fenc.txt || \
       { rc=2 ; err2=$err2" $fenc:$ienc:$doc" ; }
   rm -f $testdir/fn±×÷§¶-utf8-tmp.tex
@@ -121,7 +121,7 @@
       { rc=3 ; err3=$err3" $fenc:$ienc:$doc" ; }
   $_kpsewhich -progname=$engine $doc-tmp.tex || rc=22
   mv $job.txt $job.log $testdir/ || rc=24
-  mv $job.fls $testdir/ || : echo "FIXME" # check *.fls
+  mv $job.fls $testdir/ || rc=25
   diff $testdir/$job.txt $srcdir/tests/fn-$fenc.txt || \
       { rc=4 ; err4=$err4" $fenc:$ienc:$doc" ; }
 

Modified: trunk/Build/source/texk/web2c/lib/ChangeLog
===================================================================
--- trunk/Build/source/texk/web2c/lib/ChangeLog	2025-04-26 10:02:06 UTC (rev 75027)
+++ trunk/Build/source/texk/web2c/lib/ChangeLog	2025-04-26 13:43:08 UTC (rev 75028)
@@ -1,3 +1,8 @@
+2025-04-26  Yukimasa Morimi  <h20y6m at yahoo.co.jp>
+
+	* openclose.c: Convert recorder filename to UTF-8.
+	https://github.com/texjporg/tex-jp-build/issues/45
+
 2025-03-07  Karl Berry  <karl at tug.org>
 
 	* TL'25 release.

Modified: trunk/Build/source/texk/web2c/lib/openclose.c
===================================================================
--- trunk/Build/source/texk/web2c/lib/openclose.c	2025-04-26 10:02:06 UTC (rev 75027)
+++ trunk/Build/source/texk/web2c/lib/openclose.c	2025-04-26 13:43:08 UTC (rev 75028)
@@ -142,7 +142,10 @@
 recorder_change_filename (string new_name)
 {
    string temp = NULL;
-   
+#if defined(PTEX) && !defined(WIN32)
+   string fname0 = NULL;
+#endif
+
    if (!recorder_file)
      return;
 
@@ -151,6 +154,13 @@
    fclose (recorder_file);
 #endif /* _WIN32 */
 
+#if defined(PTEX) && !defined(WIN32)
+   fname0 = ptenc_from_internal_enc_string_to_utf8(new_name);
+   if (fname0) {
+     new_name = fname0;
+   }
+#endif
+
    /* If an output directory was specified, use it.  */
    if (output_directory) {
      temp = concat3(output_directory, DIR_SEP_STRING, new_name);
@@ -173,6 +183,10 @@
 
    if (temp)
      free (temp);
+#if defined(PTEX) && !defined(WIN32)
+   if (fname0)
+     free (fname0);
+#endif
 }
 
 /* helper for recorder_record_* */
@@ -407,17 +421,10 @@
 open_output (FILE **f_ptr, const_string fopen_mode)
 {
     string fname;
-#if defined(PTEX) && !defined(WIN32)
     string fname0;
-#endif
     boolean absolute = kpse_absolute_p(nameoffile+1, false);
 
-    /* If we have an explicit output directory, use it. */
-    if (output_directory && !absolute) {
-        fname = concat3(output_directory, DIR_SEP_STRING, nameoffile + 1);
-    } else {
-        fname = nameoffile + 1;
-    }
+    fname = nameoffile + 1;
 #if defined(PTEX) && !defined(WIN32)
     fname0 = ptenc_from_internal_enc_string_to_utf8(fname);
     if (fname0) {
@@ -425,6 +432,14 @@
         fname = fname0;
     }
 #endif
+    /* If we have an explicit output directory, use it. */
+    if (output_directory && !absolute) {
+        fname0 = concat3(output_directory, DIR_SEP_STRING, fname);
+        if (fname0) {
+            if (fname != nameoffile + 1) free(fname);
+            fname = fname0;
+        }
+    }
 
     /* Is the filename openable as given?  */
     *f_ptr = fopen (fname, fopen_mode);

Modified: trunk/Build/source/texk/web2c/ptexdir/ChangeLog
===================================================================
--- trunk/Build/source/texk/web2c/ptexdir/ChangeLog	2025-04-26 10:02:06 UTC (rev 75027)
+++ trunk/Build/source/texk/web2c/ptexdir/ChangeLog	2025-04-26 13:43:08 UTC (rev 75028)
@@ -12,6 +12,9 @@
 	tests/disp_{jfm,unbox}.tex, tests/inhibitglue_extensions.tex,
 	tests/filename_test.sh, am/ptex.am:
 	Clean up tests to prepare to remove ptexdir.
+	https://github.com/texjporg/tex-jp-build/issues/32
+	* wcfname.test: Add tests for recorder filename.
+	https://github.com/texjporg/tex-jp-build/issues/45
 
 2025-04-05  TANAKA Takuji  <ttk at t-lab.opal.ne.jp>
 

Modified: trunk/Build/source/texk/web2c/ptexdir/wcfname.test
===================================================================
--- trunk/Build/source/texk/web2c/ptexdir/wcfname.test	2025-04-26 10:02:06 UTC (rev 75027)
+++ trunk/Build/source/texk/web2c/ptexdir/wcfname.test	2025-04-26 13:43:08 UTC (rev 75028)
@@ -1,6 +1,6 @@
 #! /bin/sh -vx
 #
-# Copyright 2022-2023 Japanese TeX Development Community <issue at texjp.org>
+# Copyright 2022-2025 Japanese TeX Development Community <issue at texjp.org>
 # You may freely use, modify and/or distribute this file.
 
 engine=ptex
@@ -79,7 +79,7 @@
   $_kpsewhich -progname=$engine $doc-tmp.tex || rc=12
   $_kpsewhich -progname=$engine fn±×÷§¶-utf8-tmp.tex || rc=13
   mv $job.txt $job.log $testdir/ || rc=14
-  mv $job.fls $testdir/ || : echo "FIXME" # check *.fls
+  mv $job.fls $testdir/ || rc=15
   diff $testdir/$job.txt $srcdir/tests/fn-$fenc.txt || \
       { rc=2 ; err2=$err2" $fenc:$ienc:$doc" ; }
   rm -f $testdir/fn±×÷§¶-utf8-tmp.tex

Modified: trunk/Build/source/texk/web2c/uptexdir/ChangeLog
===================================================================
--- trunk/Build/source/texk/web2c/uptexdir/ChangeLog	2025-04-26 10:02:06 UTC (rev 75027)
+++ trunk/Build/source/texk/web2c/uptexdir/ChangeLog	2025-04-26 13:43:08 UTC (rev 75028)
@@ -21,6 +21,9 @@
 	tests/disp_{jfm,unbox}.tex, tests/inhibitglue_extensions.tex,
 	tests/filename_test.sh, am/uptex.am:
 	Clean up tests to prepare to remove ptexdir.
+	https://github.com/texjporg/tex-jp-build/issues/32
+	* wcfname0.test: Add tests for recorder filename.
+	https://github.com/texjporg/tex-jp-build/issues/45
 
 2025-04-05  TANAKA Takuji  <ttk at t-lab.opal.ne.jp>
 

Modified: trunk/Build/source/texk/web2c/uptexdir/wcfname0.test
===================================================================
--- trunk/Build/source/texk/web2c/uptexdir/wcfname0.test	2025-04-26 10:02:06 UTC (rev 75027)
+++ trunk/Build/source/texk/web2c/uptexdir/wcfname0.test	2025-04-26 13:43:08 UTC (rev 75028)
@@ -1,6 +1,6 @@
 #! /bin/sh -vx
 #
-# Copyright 2022-2023 Japanese TeX Development Community <issue at texjp.org>
+# Copyright 2022-2025 Japanese TeX Development Community <issue at texjp.org>
 # You may freely use, modify and/or distribute this file.
 
 engine=uptex
@@ -84,7 +84,7 @@
   $_kpsewhich -progname=$engine $doc-tmp.tex || rc=12
   $_kpsewhich -progname=$engine fn±×÷§¶-utf8-tmp.tex || rc=13
   mv $job.txt $job.log $testdir/ || rc=14
-  mv $job.fls $testdir/ || : echo "FIXME" # check *.fls
+  mv $job.fls $testdir/ || rc=15
   diff $testdir/$job.txt $srcdir/tests/fn-$fenc.txt || \
       { rc=2 ; err2=$err2" $fenc:$ienc:$doc" ; }
   rm -f $testdir/fn±×÷§¶-utf8-tmp.tex
@@ -123,7 +123,7 @@
   $_kpsewhich -progname=$engine $doc-tmp.tex || rc=22
   $_kpsewhich -progname=$engine fn±×÷§¶-utf8-tmp.tex || rc=23
   mv $job.txt $job.log $testdir/ || rc=24
-  mv $job.fls $testdir/ || : echo "FIXME" # check *.fls
+  mv $job.fls $testdir/ || rc=25
   diff $testdir/$job.txt $srcdir/tests/fn-$fenc.txt || \
       { rc=4 ; err4=$err4" $fenc:$ienc:$doc" ; }
 



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