texlive[55623] Build/source/texk/dvipdfm-x: Use MFOPEN() instead of
commits+kakuto at tug.org
commits+kakuto at tug.org
Mon Jun 22 08:38:14 CEST 2020
Revision: 55623
http://tug.org/svn/texlive?view=revision&revision=55623
Author: kakuto
Date: 2020-06-22 08:38:14 +0200 (Mon, 22 Jun 2020)
Log Message:
-----------
Use MFOPEN() instead of fopen(), etc.
Modified Paths:
--------------
trunk/Build/source/texk/dvipdfm-x/ChangeLog
trunk/Build/source/texk/dvipdfm-x/dpxfile.c
trunk/Build/source/texk/dvipdfm-x/dvi.c
trunk/Build/source/texk/dvipdfm-x/dvipdfmx.c
trunk/Build/source/texk/dvipdfm-x/pdfximage.c
Modified: trunk/Build/source/texk/dvipdfm-x/ChangeLog
===================================================================
--- trunk/Build/source/texk/dvipdfm-x/ChangeLog 2020-06-21 23:47:24 UTC (rev 55622)
+++ trunk/Build/source/texk/dvipdfm-x/ChangeLog 2020-06-22 06:38:14 UTC (rev 55623)
@@ -1,3 +1,11 @@
+2020-06-22 Akira Kakuto <kakuto at w32tex.org>
+
+ * dvipdfmx.c: Move dpx_delete_old_cache(image_cache_life)
+ because image caching did'nt work.
+ * dvi.c: Use MFOPEN() instead of fopen().
+ * dpxfile.c, pdfximage.c: Use generalized stat() to handle
+ UTF-8 names.
+
2020-06-21 Shunsaku Hirata <shunsaku.hirata74 at gmail.com>
* tt_cmap.c: Lower priority for Soft-hyphen U+00AD when
Modified: trunk/Build/source/texk/dvipdfm-x/dpxfile.c
===================================================================
--- trunk/Build/source/texk/dvipdfm-x/dpxfile.c 2020-06-21 23:47:24 UTC (rev 55622)
+++ trunk/Build/source/texk/dvipdfm-x/dpxfile.c 2020-06-22 06:38:14 UTC (rev 55623)
@@ -1,5 +1,5 @@
/* This is dvipdfmx, an eXtended version of dvipdfm by Mark A. Wicks.
- Copyright (C) 2007-2019 by Jin-Hwan Cho and Shunsaku Hirata,
+ Copyright (C) 2007-2020 by Jin-Hwan Cho and Shunsaku Hirata,
the dvipdfmx project team.
Copyright (C) 1998, 1999 by Mark A. Wicks <mwicks at kettering.edu>
@@ -159,9 +159,21 @@
static char _tmpbuf[PATH_MAX+1];
#endif /* MIKTEX */
-#if defined(WIN32)
+#if defined(_WIN32)
extern int utf8name_failed;
-#endif /* WIN32 */
+int fsyscp_stat(const char *path, struct stat *buffer)
+{
+ wchar_t *wpath;
+ int ret;
+ wpath = get_wstring_from_mbstring(file_system_codepage,
+ path, wpath = NULL);
+ if (wpath == NULL)
+ return -1;
+ ret = _wstat(wpath, buffer);
+ free(wpath);
+ return ret;
+}
+#endif /* _WIN32 */
#define CMDBUFSIZ 1024
static int exec_spawn (char *cmd)
@@ -1016,7 +1028,12 @@
if (dpx_clear_cache_filter(de)) {
struct stat sb;
sprintf(pathname, "%s/%s", dir, de->d_name);
+#if defined(_WIN32)
+ if (fsyscp_stat(pathname, &sb) != 0)
+ stat(pathname, &sb);
+#else
stat(pathname, &sb);
+#endif /* _WIN32 */
if (sb.st_mtime < limit) {
remove(pathname);
/* printf("remove: %s\n", pathname); */
@@ -1250,8 +1267,13 @@
if (!fqpn)
return 0;
+#if defined(_WIN32)
+ if (fsyscp_stat(fqpn, &sb) != 0 && stat(fqpn, &sb) != 0)
+ return 0;
+#else
if (stat(fqpn, &sb) != 0)
return 0;
+#endif /* _WIN32 */
if (sb.st_size == 0)
return 0;
Modified: trunk/Build/source/texk/dvipdfm-x/dvi.c
===================================================================
--- trunk/Build/source/texk/dvipdfm-x/dvi.c 2020-06-21 23:47:24 UTC (rev 55622)
+++ trunk/Build/source/texk/dvipdfm-x/dvi.c 2020-06-22 06:38:14 UTC (rev 55623)
@@ -981,13 +981,13 @@
MESG("<%s@%.2fpt", filename, ptsize * dvi2pts);
if ((path = dpx_find_dfont_file(filename)) != NULL &&
- (fp = fopen(path, "rb")) != NULL)
+ (fp = MFOPEN(path, "rb")) != NULL)
is_dfont = 1;
else if ((path = dpx_find_type1_file(filename)) != NULL)
is_type1 = 1;
else if (((path = dpx_find_opentype_file(filename)) == NULL
&& (path = dpx_find_truetype_file(filename)) == NULL)
- || (fp = fopen(path, "rb")) == NULL) {
+ || (fp = MFOPEN(path, "rb")) == NULL) {
ERROR("Cannot proceed without the font: %s", filename);
}
need_more_fonts(1);
Modified: trunk/Build/source/texk/dvipdfm-x/dvipdfmx.c
===================================================================
--- trunk/Build/source/texk/dvipdfm-x/dvipdfmx.c 2020-06-21 23:47:24 UTC (rev 55622)
+++ trunk/Build/source/texk/dvipdfm-x/dvipdfmx.c 2020-06-22 06:38:14 UTC (rev 55623)
@@ -1131,8 +1131,6 @@
kpse_set_program_enabled(kpse_pk_format, true, kpse_src_texmf_cnf);
#endif
pdf_font_set_dpi(font_dpi);
- dpx_delete_old_cache(image_cache_life);
-
if (!dvi_filename) {
if (verbose)
MESG("No dvi filename specified, reading standard input.\n");
@@ -1178,6 +1176,9 @@
}
}
+/* moved to here because image caching was not effective */
+ dpx_delete_old_cache(image_cache_life);
+
/* Encryption and Other Settings */
{
memset(&settings.encrypt, 0, sizeof(struct pdf_enc_setting));
Modified: trunk/Build/source/texk/dvipdfm-x/pdfximage.c
===================================================================
--- trunk/Build/source/texk/dvipdfm-x/pdfximage.c 2020-06-21 23:47:24 UTC (rev 55622)
+++ trunk/Build/source/texk/dvipdfm-x/pdfximage.c 2020-06-22 06:38:14 UTC (rev 55623)
@@ -1,6 +1,6 @@
/* This is dvipdfmx, an eXtended version of dvipdfm by Mark A. Wicks.
- Copyright (C) 2007-2019 by Jin-Hwan Cho and Shunsaku Hirata,
+ Copyright (C) 2007-2020 by Jin-Hwan Cho and Shunsaku Hirata,
the dvipdfmx project team.
Copyright (C) 1998, 1999 by Mark A. Wicks <mwicks at kettering.edu>
@@ -62,6 +62,9 @@
#define IMAGE_TYPE_BMP 6
#define IMAGE_TYPE_JP2 7
+#if defined(_WIN32)
+extern int fsyscp_stat(const char *path, struct stat *buffer);
+#endif /* _WIN32 */
struct attr_
{
@@ -964,9 +967,17 @@
}
#endif
+#if defined(_WIN32)
if (dpx_conf.file.keep_cache != -1 &&
+ (fsyscp_stat(temp, &stat_t)==0 || stat(temp, &stat_t)==0) &&
+ (fsyscp_stat(filename, &stat_o)==0 ||
+ stat(filename, &stat_o)==0) &&
+ stat_t.st_mtime > stat_o.st_mtime) {
+#else
+ if (dpx_conf.file.keep_cache != -1 &&
stat(temp, &stat_t)==0 && stat(filename, &stat_o)==0 &&
stat_t.st_mtime > stat_o.st_mtime) {
+#endif /* _WIN32 */
/* cache exist */
/*printf("\nLast file modification: %s", ctime(&stat_o.st_mtime));
printf("Last file modification: %s", ctime(&stat_t.st_mtime));*/
More information about the tex-live-commits
mailing list.