summaryrefslogtreecommitdiff
path: root/Build/source
diff options
context:
space:
mode:
Diffstat (limited to 'Build/source')
-rw-r--r--Build/source/texk/dvipdfm-x/ChangeLog8
-rw-r--r--Build/source/texk/dvipdfm-x/dpxfile.c28
-rw-r--r--Build/source/texk/dvipdfm-x/dvi.c4
-rw-r--r--Build/source/texk/dvipdfm-x/dvipdfmx.c5
-rw-r--r--Build/source/texk/dvipdfm-x/pdfximage.c13
5 files changed, 50 insertions, 8 deletions
diff --git a/Build/source/texk/dvipdfm-x/ChangeLog b/Build/source/texk/dvipdfm-x/ChangeLog
index e7ded141cb1..7c50f5cb4fd 100644
--- a/Build/source/texk/dvipdfm-x/ChangeLog
+++ b/Build/source/texk/dvipdfm-x/ChangeLog
@@ -1,3 +1,11 @@
+2020-06-22 Akira Kakuto <kakuto@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@gmail.com>
* tt_cmap.c: Lower priority for Soft-hyphen U+00AD when
diff --git a/Build/source/texk/dvipdfm-x/dpxfile.c b/Build/source/texk/dvipdfm-x/dpxfile.c
index 6a596d555f5..099318e89a7 100644
--- a/Build/source/texk/dvipdfm-x/dpxfile.c
+++ b/Build/source/texk/dvipdfm-x/dpxfile.c
@@ -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@kettering.edu>
@@ -159,9 +159,21 @@ miktex_find_psheader_file (const char *filename, char *buf)
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 @@ dpx_delete_old_cache (int life)
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 @@ qcheck_filetype (const char *fqpn, dpx_res_type type)
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;
diff --git a/Build/source/texk/dvipdfm-x/dvi.c b/Build/source/texk/dvipdfm-x/dvi.c
index 9ddc759bae3..e85a98a3924 100644
--- a/Build/source/texk/dvipdfm-x/dvi.c
+++ b/Build/source/texk/dvipdfm-x/dvi.c
@@ -981,13 +981,13 @@ dvi_locate_native_font (const char *filename, uint32_t index,
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);
diff --git a/Build/source/texk/dvipdfm-x/dvipdfmx.c b/Build/source/texk/dvipdfm-x/dvipdfmx.c
index 92da42f591b..21b0e92725d 100644
--- a/Build/source/texk/dvipdfm-x/dvipdfmx.c
+++ b/Build/source/texk/dvipdfm-x/dvipdfmx.c
@@ -1131,8 +1131,6 @@ main (int argc, char *argv[])
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 @@ main (int argc, char *argv[])
}
}
+/* 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));
diff --git a/Build/source/texk/dvipdfm-x/pdfximage.c b/Build/source/texk/dvipdfm-x/pdfximage.c
index f613d5b1df0..b6b536588b0 100644
--- a/Build/source/texk/dvipdfm-x/pdfximage.c
+++ b/Build/source/texk/dvipdfm-x/pdfximage.c
@@ -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@kettering.edu>
@@ -62,6 +62,9 @@ static int ps_include_page (pdf_ximage *ximage,
#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 @@ ps_include_page (pdf_ximage *ximage, const char *filename, load_options options)
}
#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));*/