texlive[69693] Build/source/texk/web2c/luatexdir: Ensures that

commits+lscarso at tug.org commits+lscarso at tug.org
Sat Feb 3 23:26:14 CET 2024


Revision: 69693
          https://tug.org/svn/texlive?view=revision&revision=69693
Author:   lscarso
Date:     2024-02-03 23:26:14 +0100 (Sat, 03 Feb 2024)
Log Message:
-----------
Ensures that setgentounicode has a glyph_unicode_tree not NULL.

Modified Paths:
--------------
    trunk/Build/source/texk/web2c/luatexdir/ChangeLog
    trunk/Build/source/texk/web2c/luatexdir/font/tounicode.c
    trunk/Build/source/texk/web2c/luatexdir/lua/lpdflib.c
    trunk/Build/source/texk/web2c/luatexdir/lua/luatex-api.h
    trunk/Build/source/texk/web2c/luatexdir/luatex_svnversion.h

Modified: trunk/Build/source/texk/web2c/luatexdir/ChangeLog
===================================================================
--- trunk/Build/source/texk/web2c/luatexdir/ChangeLog	2024-02-03 21:13:58 UTC (rev 69692)
+++ trunk/Build/source/texk/web2c/luatexdir/ChangeLog	2024-02-03 22:26:14 UTC (rev 69693)
@@ -1,3 +1,6 @@
+2024-03-24  Luigi Scarso <luigi.scarso at gmail.com>
+	* Ensures that setgentounicode has a glyph_unicode_tree not NULL
+
 2024-01-24  Luigi Scarso <luigi.scarso at gmail.com>
         * New 	kpse.in_name_ok_silent_extended and kpse.in_name_ok_silent_extended
         * In kpse mode

Modified: trunk/Build/source/texk/web2c/luatexdir/font/tounicode.c
===================================================================
--- trunk/Build/source/texk/web2c/luatexdir/font/tounicode.c	2024-02-03 21:13:58 UTC (rev 69692)
+++ trunk/Build/source/texk/web2c/luatexdir/font/tounicode.c	2024-02-03 22:26:14 UTC (rev 69693)
@@ -69,6 +69,13 @@
         avl_destroy(glyph_unicode_tree, destroy_glyph_unicode_entry);
 }
 
+void glyph_unicode_new(void)
+{
+    if (glyph_unicode_tree == NULL) {
+        glyph_unicode_tree = avl_create(comp_glyph_unicode_entry, NULL, &avl_xallocator);
+    }
+}
+
 void def_tounicode(str_number glyph, str_number unistr)
 {
     char buf[SMALL_BUF_SIZE], *p, *ph;

Modified: trunk/Build/source/texk/web2c/luatexdir/lua/lpdflib.c
===================================================================
--- trunk/Build/source/texk/web2c/luatexdir/lua/lpdflib.c	2024-02-03 21:13:58 UTC (rev 69692)
+++ trunk/Build/source/texk/web2c/luatexdir/lua/lpdflib.c	2024-02-03 22:26:14 UTC (rev 69693)
@@ -828,6 +828,8 @@
 
 static int setpdfgentounicode(lua_State * L)
 {
+    /* ensures that glyph_unicode_tree is not null */
+    glyph_unicode_new(); 
     if (lua_type(L, 1) == LUA_TNUMBER) {
         set_pdf_gen_tounicode(lua_tointeger(L, 1));
     }

Modified: trunk/Build/source/texk/web2c/luatexdir/lua/luatex-api.h
===================================================================
--- trunk/Build/source/texk/web2c/luatexdir/lua/luatex-api.h	2024-02-03 21:13:58 UTC (rev 69692)
+++ trunk/Build/source/texk/web2c/luatexdir/lua/luatex-api.h	2024-02-03 22:26:14 UTC (rev 69693)
@@ -159,6 +159,7 @@
 extern int font_to_lua(lua_State * L, int f, int usecache);
 extern int font_from_lua(lua_State * L, int f); /* return is boolean */
 extern int characters_from_lua(lua_State * L, int f); /* return is boolean */
+extern void glyph_unicode_new(void); /* ensures that glyph_unicode_tree is not null */
 
 extern int luaopen_token(lua_State * L);
 extern void tokenlist_to_lua(lua_State * L, int p);

Modified: trunk/Build/source/texk/web2c/luatexdir/luatex_svnversion.h
===================================================================
--- trunk/Build/source/texk/web2c/luatexdir/luatex_svnversion.h	2024-02-03 21:13:58 UTC (rev 69692)
+++ trunk/Build/source/texk/web2c/luatexdir/luatex_svnversion.h	2024-02-03 22:26:14 UTC (rev 69693)
@@ -1,4 +1,4 @@
 #ifndef luatex_svn_revision_h
 #define luatex_svn_revision_h
-#define luatex_svn_revision 7601
+#define luatex_svn_revision 7602
 #endif



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