diff options
Diffstat (limited to 'Build')
-rw-r--r-- | Build/source/texk/xdvipdfmx/ChangeLog.TL | 5 | ||||
-rw-r--r-- | Build/source/texk/xdvipdfmx/src/dvi.c | 15 |
2 files changed, 16 insertions, 4 deletions
diff --git a/Build/source/texk/xdvipdfmx/ChangeLog.TL b/Build/source/texk/xdvipdfmx/ChangeLog.TL index 5b057b955d3..a7469661bd5 100644 --- a/Build/source/texk/xdvipdfmx/ChangeLog.TL +++ b/Build/source/texk/xdvipdfmx/ChangeLog.TL @@ -1,6 +1,11 @@ ChangeLog.TL: TeX Live (TL) changes for xdvipdfmx ================================================= +2012-08-18 Akira Kakuto <kakuto@fuk.kindai.ac.jp> + + * dvi.c: Fix a bug in dvi_init(). The old one fails for dvi or xdv + files of very short name. For example "xdvipdfmx t" fails for t.xdv. + 2012-05-06 Akira Kakuto <kakuto@fuk.kindai.ac.jp> * fontmap.c: fix a typo. allow pdftex.map without PS name. diff --git a/Build/source/texk/xdvipdfmx/src/dvi.c b/Build/source/texk/xdvipdfmx/src/dvi.c index ba2d251f260..ca36a301fa7 100644 --- a/Build/source/texk/xdvipdfmx/src/dvi.c +++ b/Build/source/texk/xdvipdfmx/src/dvi.c @@ -2253,6 +2253,12 @@ dvi_do_page (long n, } } +#ifdef WIN32 +#define STR_CMP strcasecmp +#else +#define STR_CMP strcmp +#endif + double dvi_init (char *dvi_filename, double mag) { @@ -2271,12 +2277,13 @@ dvi_init (char *dvi_filename, double mag) else { dvi_file = MFOPEN(dvi_filename, FOPEN_RBIN_MODE); if (!dvi_file) { - if ((strlen(dvi_filename) > 4) - && ( strcmp(dvi_filename + strlen(dvi_filename) - 4, ".dvi") != 0 + char *p; + p = strrchr(dvi_filename, '.'); #ifdef XETEX - || strcmp(dvi_filename + strlen(dvi_filename) - 4, ".xdv") != 0 + if (p == NULL || (STR_CMP(p, ".dvi") && STR_CMP(p, ".xdv"))) { +#else + if (p == NULL || STR_CMP(p, ".dvi")) { #endif - )) { #ifdef XETEX strcat(dvi_filename, ".xdv"); dvi_file = MFOPEN(dvi_filename, FOPEN_RBIN_MODE); |