texlive[49955] Build/source/texk: kanji-internal (ptex and friends 1

commits+hironobu at tug.org commits+hironobu at tug.org
Wed Feb 6 11:58:23 CET 2019


Revision: 49955
          http://tug.org/svn/texlive?view=revision&revision=49955
Author:   hironobu
Date:     2019-02-06 11:58:23 +0100 (Wed, 06 Feb 2019)
Log Message:
-----------
kanji-internal (ptex and friends 1 of 5)

Modified Paths:
--------------
    trunk/Build/source/texk/ptexenc/ChangeLog
    trunk/Build/source/texk/ptexenc/ptexenc/ptexenc.h
    trunk/Build/source/texk/ptexenc/ptexenc.c
    trunk/Build/source/texk/web2c/Makefile.in
    trunk/Build/source/texk/web2c/eptexdir/ChangeLog
    trunk/Build/source/texk/web2c/eptexdir/eptex.defines
    trunk/Build/source/texk/web2c/ptexdir/ChangeLog
    trunk/Build/source/texk/web2c/ptexdir/am/ptex.am
    trunk/Build/source/texk/web2c/ptexdir/kanji.c
    trunk/Build/source/texk/web2c/ptexdir/kanji.h
    trunk/Build/source/texk/web2c/ptexdir/ptex-base.ch
    trunk/Build/source/texk/web2c/ptexdir/ptex.defines
    trunk/Build/source/texk/web2c/uptexdir/ChangeLog
    trunk/Build/source/texk/web2c/uptexdir/kanji_dump.c
    trunk/Build/source/texk/web2c/uptexdir/uptex-m.ch

Added Paths:
-----------
    trunk/Build/source/texk/web2c/ptexdir/kanji_dump.c

Modified: trunk/Build/source/texk/ptexenc/ChangeLog
===================================================================
--- trunk/Build/source/texk/ptexenc/ChangeLog	2019-02-06 01:23:42 UTC (rev 49954)
+++ trunk/Build/source/texk/ptexenc/ChangeLog	2019-02-06 10:58:23 UTC (rev 49955)
@@ -1,3 +1,8 @@
+2019-01-23  Hironobu Yamashita  <h.y.acetaminophen at gmail.com>
+
+	* ptexenc.c, ptexenc/ptexenc.h: define enc_to_string() and
+	get_internal_enc() as extern.
+
 2018-06-14  Akira Kakuto  <kakuto at fuk.kindai.ac.jp>
 
 	* ptexenc.c, ptexenc/ptexenc.h: remove sjisterminal (w32 only).

Modified: trunk/Build/source/texk/ptexenc/ptexenc/ptexenc.h
===================================================================
--- trunk/Build/source/texk/ptexenc/ptexenc/ptexenc.h	2019-02-06 01:23:42 UTC (rev 49954)
+++ trunk/Build/source/texk/ptexenc/ptexenc/ptexenc.h	2019-02-06 10:58:23 UTC (rev 49955)
@@ -39,6 +39,10 @@
 #define getencstring  get_enc_string
 #define setencstring  set_enc_string
 
+/* get internal Kanji encode (used in kanji_dump.c) */
+extern PTENCDLL const_string enc_to_string(int enc);
+extern PTENCDLL int get_internal_enc(void);
+
 /* decide if internal Kanji encode is SJIS/UPTEX or not */
 extern PTENCDLL boolean  is_internalSJIS(void);
 extern PTENCDLL boolean  is_internalEUC(void);

Modified: trunk/Build/source/texk/ptexenc/ptexenc.c
===================================================================
--- trunk/Build/source/texk/ptexenc/ptexenc.c	2019-02-06 01:23:42 UTC (rev 49954)
+++ trunk/Build/source/texk/ptexenc/ptexenc.c	2019-02-06 10:58:23 UTC (rev 49955)
@@ -49,7 +49,7 @@
 static int internal_enc = ENC_UNKNOWN;
 static int terminal_enc = ENC_UNKNOWN;
 
-static const_string enc_to_string(int enc)
+const_string enc_to_string(int enc)
 {
     switch (enc) {
     case ENC_JIS:  return "jis";
@@ -114,7 +114,7 @@
     return file_enc;
 }
 
-static int get_internal_enc(void)
+int get_internal_enc(void)
 {
     if (internal_enc == ENC_UNKNOWN) set_internal_enc(get_default_enc());
     return internal_enc;

Modified: trunk/Build/source/texk/web2c/Makefile.in
===================================================================
--- trunk/Build/source/texk/web2c/Makefile.in	2019-02-06 01:23:42 UTC (rev 49954)
+++ trunk/Build/source/texk/web2c/Makefile.in	2019-02-06 10:58:23 UTC (rev 49955)
@@ -550,7 +550,8 @@
 libff_a_OBJECTS = $(am_libff_a_OBJECTS)
 libkanji_a_AR = $(AR) $(ARFLAGS)
 libkanji_a_LIBADD =
-am_libkanji_a_OBJECTS = ptexdir/libkanji_a-kanji.$(OBJEXT)
+am_libkanji_a_OBJECTS = ptexdir/libkanji_a-kanji.$(OBJEXT) \
+	ptexdir/libkanji_a-kanji_dump.$(OBJEXT)
 libkanji_a_OBJECTS = $(am_libkanji_a_OBJECTS)
 libluaffi_a_AR = $(AR) $(ARFLAGS)
 libluaffi_a_LIBADD =
@@ -2063,6 +2064,7 @@
 	pdftexdir/regex/$(DEPDIR)/libpdftex_a-regex_internal.Po \
 	pdftexdir/regex/$(DEPDIR)/libpdftex_a-regexec.Po \
 	ptexdir/$(DEPDIR)/libkanji_a-kanji.Po \
+	ptexdir/$(DEPDIR)/libkanji_a-kanji_dump.Po \
 	ptexdir/$(DEPDIR)/ptex-ptexextra.Po \
 	synctexdir/$(DEPDIR)/eptex-synctex.Po \
 	synctexdir/$(DEPDIR)/etex-synctex.Po \
@@ -3626,7 +3628,7 @@
 p_tangle = $(tangle_silent)WEBINPUTS=.:$(srcdir)/ptexdir:$(srcdir) $(buildenv) $(TANGLE)
 pweb_programs = pbibtex pdvitype ppltotf ptftopl
 pproglib = lib/libp.a
-libkanji_a_SOURCES = ptexdir/kanji.c ptexdir/kanji.h
+libkanji_a_SOURCES = ptexdir/kanji.c ptexdir/kanji.h ptexdir/kanji_dump.c
 libkanji_a_CPPFLAGS = $(ptex_cppflags)
 ptex_CPPFLAGS = $(ptex_cppflags) $(am__append_121)
 
@@ -5292,6 +5294,8 @@
 	@: > ptexdir/$(DEPDIR)/$(am__dirstamp)
 ptexdir/libkanji_a-kanji.$(OBJEXT): ptexdir/$(am__dirstamp) \
 	ptexdir/$(DEPDIR)/$(am__dirstamp)
+ptexdir/libkanji_a-kanji_dump.$(OBJEXT): ptexdir/$(am__dirstamp) \
+	ptexdir/$(DEPDIR)/$(am__dirstamp)
 
 libkanji.a: $(libkanji_a_OBJECTS) $(libkanji_a_DEPENDENCIES) $(EXTRA_libkanji_a_DEPENDENCIES) 
 	$(AM_V_at)-rm -f libkanji.a
@@ -7737,6 +7741,7 @@
 @AMDEP_TRUE@@am__include@ @am__quote at pdftexdir/regex/$(DEPDIR)/libpdftex_a-regex_internal.Po at am__quote@ # am--include-marker
 @AMDEP_TRUE@@am__include@ @am__quote at pdftexdir/regex/$(DEPDIR)/libpdftex_a-regexec.Po at am__quote@ # am--include-marker
 @AMDEP_TRUE@@am__include@ @am__quote at ptexdir/$(DEPDIR)/libkanji_a-kanji.Po at am__quote@ # am--include-marker
+ at AMDEP_TRUE@@am__include@ @am__quote at ptexdir/$(DEPDIR)/libkanji_a-kanji_dump.Po at am__quote@ # am--include-marker
 @AMDEP_TRUE@@am__include@ @am__quote at ptexdir/$(DEPDIR)/ptex-ptexextra.Po at am__quote@ # am--include-marker
 @AMDEP_TRUE@@am__include@ @am__quote at synctexdir/$(DEPDIR)/eptex-synctex.Po at am__quote@ # am--include-marker
 @AMDEP_TRUE@@am__include@ @am__quote at synctexdir/$(DEPDIR)/etex-synctex.Po at am__quote@ # am--include-marker
@@ -8408,6 +8413,20 @@
 @AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
 @am__fastdepCC_FALSE@	$(AM_V_CC at am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libkanji_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o ptexdir/libkanji_a-kanji.obj `if test -f 'ptexdir/kanji.c'; then $(CYGPATH_W) 'ptexdir/kanji.c'; else $(CYGPATH_W) '$(srcdir)/ptexdir/kanji.c'; fi`
 
+ptexdir/libkanji_a-kanji_dump.o: ptexdir/kanji_dump.c
+ at am__fastdepCC_TRUE@	$(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libkanji_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT ptexdir/libkanji_a-kanji_dump.o -MD -MP -MF ptexdir/$(DEPDIR)/libkanji_a-kanji_dump.Tpo -c -o ptexdir/libkanji_a-kanji_dump.o `test -f 'ptexdir/kanji_dump.c' || echo '$(srcdir)/'`ptexdir/kanji_dump.c
+ at am__fastdepCC_TRUE@	$(AM_V_at)$(am__mv) ptexdir/$(DEPDIR)/libkanji_a-kanji_dump.Tpo ptexdir/$(DEPDIR)/libkanji_a-kanji_dump.Po
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	$(AM_V_CC)source='ptexdir/kanji_dump.c' object='ptexdir/libkanji_a-kanji_dump.o' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@	$(AM_V_CC at am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libkanji_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o ptexdir/libkanji_a-kanji_dump.o `test -f 'ptexdir/kanji_dump.c' || echo '$(srcdir)/'`ptexdir/kanji_dump.c
+
+ptexdir/libkanji_a-kanji_dump.obj: ptexdir/kanji_dump.c
+ at am__fastdepCC_TRUE@	$(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libkanji_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT ptexdir/libkanji_a-kanji_dump.obj -MD -MP -MF ptexdir/$(DEPDIR)/libkanji_a-kanji_dump.Tpo -c -o ptexdir/libkanji_a-kanji_dump.obj `if test -f 'ptexdir/kanji_dump.c'; then $(CYGPATH_W) 'ptexdir/kanji_dump.c'; else $(CYGPATH_W) '$(srcdir)/ptexdir/kanji_dump.c'; fi`
+ at am__fastdepCC_TRUE@	$(AM_V_at)$(am__mv) ptexdir/$(DEPDIR)/libkanji_a-kanji_dump.Tpo ptexdir/$(DEPDIR)/libkanji_a-kanji_dump.Po
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	$(AM_V_CC)source='ptexdir/kanji_dump.c' object='ptexdir/libkanji_a-kanji_dump.obj' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@	$(AM_V_CC at am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libkanji_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o ptexdir/libkanji_a-kanji_dump.obj `if test -f 'ptexdir/kanji_dump.c'; then $(CYGPATH_W) 'ptexdir/kanji_dump.c'; else $(CYGPATH_W) '$(srcdir)/ptexdir/kanji_dump.c'; fi`
+
 luatexdir/luaffi/libluaffi_a-call.o: luatexdir/luaffi/call.c
 @am__fastdepCC_TRUE@	$(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libluaffi_a_CPPFLAGS) $(CPPFLAGS) $(libluaffi_a_CFLAGS) $(CFLAGS) -MT luatexdir/luaffi/libluaffi_a-call.o -MD -MP -MF luatexdir/luaffi/$(DEPDIR)/libluaffi_a-call.Tpo -c -o luatexdir/luaffi/libluaffi_a-call.o `test -f 'luatexdir/luaffi/call.c' || echo '$(srcdir)/'`luatexdir/luaffi/call.c
 @am__fastdepCC_TRUE@	$(AM_V_at)$(am__mv) luatexdir/luaffi/$(DEPDIR)/libluaffi_a-call.Tpo luatexdir/luaffi/$(DEPDIR)/libluaffi_a-call.Po
@@ -17086,6 +17105,7 @@
 	-rm -f pdftexdir/regex/$(DEPDIR)/libpdftex_a-regex_internal.Po
 	-rm -f pdftexdir/regex/$(DEPDIR)/libpdftex_a-regexec.Po
 	-rm -f ptexdir/$(DEPDIR)/libkanji_a-kanji.Po
+	-rm -f ptexdir/$(DEPDIR)/libkanji_a-kanji_dump.Po
 	-rm -f ptexdir/$(DEPDIR)/ptex-ptexextra.Po
 	-rm -f synctexdir/$(DEPDIR)/eptex-synctex.Po
 	-rm -f synctexdir/$(DEPDIR)/etex-synctex.Po
@@ -17737,6 +17757,7 @@
 	-rm -f pdftexdir/regex/$(DEPDIR)/libpdftex_a-regex_internal.Po
 	-rm -f pdftexdir/regex/$(DEPDIR)/libpdftex_a-regexec.Po
 	-rm -f ptexdir/$(DEPDIR)/libkanji_a-kanji.Po
+	-rm -f ptexdir/$(DEPDIR)/libkanji_a-kanji_dump.Po
 	-rm -f ptexdir/$(DEPDIR)/ptex-ptexextra.Po
 	-rm -f synctexdir/$(DEPDIR)/eptex-synctex.Po
 	-rm -f synctexdir/$(DEPDIR)/etex-synctex.Po

Modified: trunk/Build/source/texk/web2c/eptexdir/ChangeLog
===================================================================
--- trunk/Build/source/texk/web2c/eptexdir/ChangeLog	2019-02-06 01:23:42 UTC (rev 49954)
+++ trunk/Build/source/texk/web2c/eptexdir/ChangeLog	2019-02-06 10:58:23 UTC (rev 49955)
@@ -1,3 +1,7 @@
+2019-01-23  Hironobu Yamashita  <h.y.acetaminophen at gmail.com>
+
+	* eptex.defines: Add dumpkanji and undumpkanji.
+
 2018-09-09  Karl Berry  <karl at tug.org>
 
 	* eptriptest.test,

Modified: trunk/Build/source/texk/web2c/eptexdir/eptex.defines
===================================================================
--- trunk/Build/source/texk/web2c/eptexdir/eptex.defines	2019-02-06 01:23:42 UTC (rev 49954)
+++ trunk/Build/source/texk/web2c/eptexdir/eptex.defines	2019-02-06 10:58:23 UTC (rev 49955)
@@ -40,6 +40,9 @@
 @define function getintone ();
 @define procedure setintone ();
 
+ at define procedure dumpkanji ();
+ at define procedure undumpkanji ();
+
 @define procedure initstarttime;
 @define procedure getcreationdate;
 @define procedure getfilemoddate();

Modified: trunk/Build/source/texk/web2c/ptexdir/ChangeLog
===================================================================
--- trunk/Build/source/texk/web2c/ptexdir/ChangeLog	2019-02-06 01:23:42 UTC (rev 49954)
+++ trunk/Build/source/texk/web2c/ptexdir/ChangeLog	2019-02-06 10:58:23 UTC (rev 49955)
@@ -1,3 +1,17 @@
+2019-01-23  Hironobu Yamashita  <h.y.acetaminophen at gmail.com>
+
+	* ptex-base.ch: Add dump_kanji and undump_kanji.
+	* ptex.defines: Add dumpkanji and undumpkanji.
+	* kanji.c: Factor out init_kanji().
+	* kanji_dump.c: New file for dumping/undumping kanji encoding.
+	* kanji.h: Add init_kanji(), dump_kanji(), and undump_kanji().
+	* am/ptex.am (libkanji_a_SOURCES): Add kanji_dump.c.
+	(all changes based on tl r23753 of upTeX, dated 2011-08-29.)
+
+	* kanji_dump.c: Throw a warning when kanji internal encoding
+	is incompatible with the preloaded format.
+	https://github.com/texjporg/tex-jp-build/issues/55
+
 2018-09-09  Karl Berry  <karl at tug.org>
 
 	* ptriptest.test: LC_ALL=LANGUAGE=C.

Modified: trunk/Build/source/texk/web2c/ptexdir/am/ptex.am
===================================================================
--- trunk/Build/source/texk/web2c/ptexdir/am/ptex.am	2019-02-06 01:23:42 UTC (rev 49954)
+++ trunk/Build/source/texk/web2c/ptexdir/am/ptex.am	2019-02-06 10:58:23 UTC (rev 49955)
@@ -21,7 +21,7 @@
 ## libkanji.a for pTeX and e-pTeX
 ##
 EXTRA_LIBRARIES += libkanji.a
-libkanji_a_SOURCES = ptexdir/kanji.c ptexdir/kanji.h
+libkanji_a_SOURCES = ptexdir/kanji.c ptexdir/kanji.h ptexdir/kanji_dump.c
 libkanji_a_CPPFLAGS = $(ptex_cppflags)
 
 ## pTeX

Modified: trunk/Build/source/texk/web2c/ptexdir/kanji.c
===================================================================
--- trunk/Build/source/texk/web2c/ptexdir/kanji.c	2019-02-06 01:23:42 UTC (rev 49954)
+++ trunk/Build/source/texk/web2c/ptexdir/kanji.c	2019-02-06 10:58:23 UTC (rev 49955)
@@ -72,12 +72,8 @@
     return Hi(toDVI(c));
 }
 
-void init_default_kanji (const_string file_str, const_string internal_str)
+void init_kanji (const_string file_str, const_string internal_str)
 {
-    char *p;
-
-    enable_UPTEX (false); /* disable */
-
     if (!set_enc_string (file_str, internal_str)) {
         fprintf (stderr, "Bad kanji encoding \"%s\" or \"%s\".\n",
                  file_str ? file_str  : "NULL",
@@ -84,7 +80,16 @@
                  internal_str ? internal_str : "NULL");
         uexit(1);
     }
+}
 
+void init_default_kanji (const_string file_str, const_string internal_str)
+{
+    char *p;
+
+    enable_UPTEX (false); /* disable */
+
+    init_kanji (file_str, internal_str);
+
     p = getenv ("PTEX_KANJI_ENC");
     if (p) {
         if (!set_enc_string (p, NULL))

Modified: trunk/Build/source/texk/web2c/ptexdir/kanji.h
===================================================================
--- trunk/Build/source/texk/web2c/ptexdir/kanji.h	2019-02-06 01:23:42 UTC (rev 49954)
+++ trunk/Build/source/texk/web2c/ptexdir/kanji.h	2019-02-06 10:58:23 UTC (rev 49955)
@@ -39,6 +39,7 @@
 #define calcpos calc_pos
 extern integer kcatcodekey (integer c);
 
+extern void init_kanji (const_string file_str, const_string internal_str);
 extern void init_default_kanji (const_string file_str, const_string internal_str);
 #ifdef PBIBTEX
 /* pBibTeX is EUC only */
@@ -63,4 +64,9 @@
 #define inputline2(fp,buff,pos,size) input_line2(fp,buff,pos,size,NULL)
 #endif
 
+extern void dump_kanji (FILE *fp);
+extern void undump_kanji (FILE *fp);
+#define dumpkanji dump_kanji
+#define undumpkanji undump_kanji
+
 #endif /* not KANJI_H */

Added: trunk/Build/source/texk/web2c/ptexdir/kanji_dump.c
===================================================================
--- trunk/Build/source/texk/web2c/ptexdir/kanji_dump.c	                        (rev 0)
+++ trunk/Build/source/texk/web2c/ptexdir/kanji_dump.c	2019-02-06 10:58:23 UTC (rev 49955)
@@ -0,0 +1,48 @@
+/*
+ *  Dump/undump Kanji encoding for (e)ptex.
+ */
+
+#include "kanji.h"
+#include <texmfmp.h>
+
+void dump_kanji (FILE *fp)
+{
+    char buffer[12];
+    const char *p = get_enc_string ();
+    size_t len = strlen (p);
+
+    if (len > 11) {
+        fprintf (stderr, "Kanji encoding string \"%s\" exceeds 11 bytes.\n", p);
+        uexit(1);
+    }
+
+    strcpy (buffer, p);
+    for (len++; len < 12; len++)
+        buffer[len] = 0;
+    do_dump (buffer, 1, 12, fp);
+}
+
+void undump_kanji (FILE *fp)
+{
+    char buffer[12];
+    char *p;
+    int i;
+
+    do_undump (buffer, 1, 12, fp);
+    buffer[11] = 0;  /* force string termination, just in case */
+
+    p = strchr (buffer, '.');
+    if (p)
+        *p++ = 0;
+    else
+        p = buffer;
+
+    i = get_internal_enc();
+
+    /* Now BUFFER and P are the file and internal encoding strings.  */
+    init_kanji (NULL, p);
+    if (get_internal_enc() != i) {
+        fprintf (stderr, "Option --kanji-internal invalid when a format file is loaded.\n", p);
+        fprintf (stderr, "I'll stick to %s.\n", enc_to_string(get_internal_enc()));
+    }
+}


Property changes on: trunk/Build/source/texk/web2c/ptexdir/kanji_dump.c
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Modified: trunk/Build/source/texk/web2c/ptexdir/ptex-base.ch
===================================================================
--- trunk/Build/source/texk/web2c/ptexdir/ptex-base.ch	2019-02-06 01:23:42 UTC (rev 49954)
+++ trunk/Build/source/texk/web2c/ptexdir/ptex-base.ch	2019-02-06 10:58:23 UTC (rev 49955)
@@ -6144,6 +6144,20 @@
 show_mode: @<Show the current japanese processing mode@>;
 @z
 
+ at x
+libc_free(format_engine);@/
+ at y
+libc_free(format_engine);@/
+dump_kanji(fmt_file);
+ at z
+
+ at x
+libc_free(format_engine);
+ at y
+libc_free(format_engine);
+undump_kanji(fmt_file);
+ at z
+
 @x l.24982
 font_info:=xmalloc_array(fmemory_word, font_mem_size);
 @y

Modified: trunk/Build/source/texk/web2c/ptexdir/ptex.defines
===================================================================
--- trunk/Build/source/texk/web2c/ptexdir/ptex.defines	2019-02-06 01:23:42 UTC (rev 49954)
+++ trunk/Build/source/texk/web2c/ptexdir/ptex.defines	2019-02-06 10:58:23 UTC (rev 49955)
@@ -28,4 +28,6 @@
 @define function calcpos ();
 @define function kcatcodekey ();
 
+ at define procedure dumpkanji ();
 @define procedure initkanji;
+ at define procedure undumpkanji ();

Modified: trunk/Build/source/texk/web2c/uptexdir/ChangeLog
===================================================================
--- trunk/Build/source/texk/web2c/uptexdir/ChangeLog	2019-02-06 01:23:42 UTC (rev 49954)
+++ trunk/Build/source/texk/web2c/uptexdir/ChangeLog	2019-02-06 10:58:23 UTC (rev 49955)
@@ -1,3 +1,9 @@
+2019-01-23  Hironobu Yamashita  <h.y.acetaminophen at gmail.com>
+
+	* kanji_dump.c: Throw a warning when kanji internal encoding
+	is incompatible with the preloaded format.
+	https://github.com/texjporg/tex-jp-build/issues/55
+
 2018-09-16  TANAKA Takuji  <ttk at t-lab.opal.ne.jp>
 
 	* upbibtex.ch: Fix bug of substring$

Modified: trunk/Build/source/texk/web2c/uptexdir/kanji_dump.c
===================================================================
--- trunk/Build/source/texk/web2c/uptexdir/kanji_dump.c	2019-02-06 01:23:42 UTC (rev 49954)
+++ trunk/Build/source/texk/web2c/uptexdir/kanji_dump.c	2019-02-06 10:58:23 UTC (rev 49955)
@@ -26,6 +26,7 @@
 {
     char buffer[12];
     char *p;
+    int i;
 
     do_undump (buffer, 1, 12, fp);
     buffer[11] = 0;  /* force string termination, just in case */
@@ -36,6 +37,12 @@
     else
         p = buffer;
 
+    i = get_internal_enc();
+
     /* Now BUFFER and P are the file and internal encoding strings.  */
     init_kanji (NULL, p);
+    if (get_internal_enc() != i) {
+        fprintf (stderr, "Option --kanji-internal invalid when a format file is loaded.\n", p);
+        fprintf (stderr, "I'll stick to %s.\n", enc_to_string(get_internal_enc()));
+    }
 }

Modified: trunk/Build/source/texk/web2c/uptexdir/uptex-m.ch
===================================================================
--- trunk/Build/source/texk/web2c/uptexdir/uptex-m.ch	2019-02-06 01:23:42 UTC (rev 49954)
+++ trunk/Build/source/texk/web2c/uptexdir/uptex-m.ch	2019-02-06 10:58:23 UTC (rev 49955)
@@ -1082,20 +1082,6 @@
 @z
 
 @x
-libc_free(format_engine);@/
- at y
-libc_free(format_engine);@/
-dump_kanji(fmt_file);
- at z
-
- at x
-libc_free(format_engine);
- at y
-libc_free(format_engine);
-undump_kanji(fmt_file);
- at z
-
- at x
 @d set_auto_xspacing_code=3
 @y
 @d set_auto_xspacing_code=3



More information about the tex-live-commits mailing list