diff options
Diffstat (limited to 'Build/source/texk/dvipdfm-x/dvi.c')
-rw-r--r-- | Build/source/texk/dvipdfm-x/dvi.c | 18 |
1 files changed, 8 insertions, 10 deletions
diff --git a/Build/source/texk/dvipdfm-x/dvi.c b/Build/source/texk/dvipdfm-x/dvi.c index f0dd4393d0c..1c8b2f38eff 100644 --- a/Build/source/texk/dvipdfm-x/dvi.c +++ b/Build/source/texk/dvipdfm-x/dvi.c @@ -923,7 +923,7 @@ dvi_locate_native_font (const char *filename, uint32_t index, fontmap_rec *mrec; char *fontmap_key; FILE *fp; - char *path = strdup(filename); + char *path; sfnt *sfont; unsigned offset = 0; struct tt_head_table *head; @@ -933,15 +933,13 @@ dvi_locate_native_font (const char *filename, uint32_t index, if (verbose) MESG("<%s@%.2fpt", filename, ptsize * dvi2pts); - fp = fopen(path, "rb"); - if (!fp && - ((path = dpx_find_opentype_file(filename)) != NULL - || (path = dpx_find_truetype_file(filename)) != NULL - || (path = dpx_find_type1_file(filename)) != NULL - || (path = dpx_find_dfont_file(filename)) != NULL) ) { - fp = fopen(path, "rb"); - } - if (!fp) { + if ((fp = fopen(filename, "rb")) != NULL) + path = strdup(filename); + else if (((path = dpx_find_opentype_file(filename)) == NULL + && (path = dpx_find_truetype_file(filename)) == NULL + && (path = dpx_find_type1_file(filename)) == NULL + && (path = dpx_find_dfont_file(filename)) == NULL) + || (fp = fopen(path, "rb")) == NULL) { ERROR("Cannot proceed without the font: %s", filename); } need_more_fonts(1); |