texlive[49186] Build/source/texk/web2c/lib: Complete getfiledump()

commits+kakuto at tug.org commits+kakuto at tug.org
Sun Nov 18 05:06:33 CET 2018


Revision: 49186
          http://tug.org/svn/texlive?view=revision&revision=49186
Author:   kakuto
Date:     2018-11-18 05:06:33 +0100 (Sun, 18 Nov 2018)
Log Message:
-----------
Complete getfiledump() for XeTeX.

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	2018-11-18 01:23:14 UTC (rev 49185)
+++ trunk/Build/source/texk/web2c/lib/ChangeLog	2018-11-18 04:06:33 UTC (rev 49186)
@@ -2,7 +2,7 @@
 
 	* texmfmp.c: Make necessary changes for XeTeX in
 	getcreationdate(), getfilemoddate(), getfilesize(),
-	and getfiledump(). getfiledump() is still incomplete.
+	and getfiledump().
 
 2018-11-17  Joseph Wright  <joseph.wright at morningstar2.co.uk>
 

Modified: trunk/Build/source/texk/web2c/lib/texmfmp.c
===================================================================
--- trunk/Build/source/texk/web2c/lib/texmfmp.c	2018-11-18 01:23:14 UTC (rev 49185)
+++ trunk/Build/source/texk/web2c/lib/texmfmp.c	2018-11-18 04:06:33 UTC (rev 49186)
@@ -3254,7 +3254,10 @@
     poolpointer data_ptr;
     poolpointer data_end;
     char *file_name;
-
+#if defined(XeTeX)
+    char *readbuffer, strbuf[3];
+    int j, k;
+#endif
     if (length == 0) {
         /* empty result string */
         return;
@@ -3287,6 +3290,18 @@
         xfree(file_name);
         return;
     }
+#if defined(XeTeX)
+    readbuffer = (char *)xmalloc (length + 1);
+    read = fread(readbuffer, sizeof(char), length, f);
+    fclose(f);
+    for (j = 0; j < read; j++) {
+        i = snprintf (strbuf, 3, "%.2X", (unsigned int)readbuffer[j]);
+        check_nprintf(i, 3);
+        for (k = 0; k < i; k++)
+            strpool[poolptr++] = (uint16_t)strbuf[k];
+    }
+    xfree (readbuffer);
+#else
     /* there is enough space in the string pool, the read
        data are put in the upper half of the result, thus
        the conversion to hex can be done without overwriting
@@ -3303,6 +3318,7 @@
         check_nprintf(i, 3);
         poolptr += i;
     }
+#endif /* XeTeX */
     xfree(file_name);
 }
 



More information about the tex-live-commits mailing list