From faa0cebb8ae3c94b13b51ff2136bc682f746028d Mon Sep 17 00:00:00 2001 From: Akira Kakuto Date: Wed, 20 Sep 2017 06:58:43 +0000 Subject: kpathsea: Fix to return actual file names (W32 only) git-svn-id: svn://tug.org/texlive/trunk@45352 c570f23f-e606-0410-a88d-b1316a301751 --- Build/source/texk/kpathsea/ChangeLog | 4 ++++ Build/source/texk/kpathsea/tex-file.c | 19 ++++++++++++++++++- 2 files changed, 22 insertions(+), 1 deletion(-) diff --git a/Build/source/texk/kpathsea/ChangeLog b/Build/source/texk/kpathsea/ChangeLog index d4cd2d5dbed..03c0b90f4a7 100644 --- a/Build/source/texk/kpathsea/ChangeLog +++ b/Build/source/texk/kpathsea/ChangeLog @@ -1,3 +1,7 @@ +2017-09-20 Akira Kakuto + + * tex-file.c: Fix to return actual file names (W32 only). + 2017-09-19 Akira Kakuto * db.c: Fix for DOSISH systems in which _WIN32 is not defined. diff --git a/Build/source/texk/kpathsea/tex-file.c b/Build/source/texk/kpathsea/tex-file.c index a103520cc18..0a4e205f35b 100644 --- a/Build/source/texk/kpathsea/tex-file.c +++ b/Build/source/texk/kpathsea/tex-file.c @@ -1011,6 +1011,9 @@ kpathsea_find_file_generic (kpathsea kpse, const_string const_name, kpse_file_format_type format, boolean must_exist, boolean all) { +#if defined(_WIN32) && !defined(__MINGW32__) + char tmpbuffer[512]; +#endif string *target, name; const_string *ext; unsigned count; @@ -1133,7 +1136,21 @@ kpathsea_find_file_generic (kpathsea kpse, const_string const_name, } free (name); - +#if defined(_WIN32) && !defined(__MINGW32__) + if (ret && *ret) { + if (all) { + for (count = 0; ret[count] != NULL; count++) { + if (kpathsea_getlongpath (kpse, tmpbuffer, ret[count], 500) && + strlen (tmpbuffer) == strlen (ret[count])) + strcpy (ret[count], tmpbuffer); + } + } else { + if (kpathsea_getlongpath (kpse, tmpbuffer, *ret, 500) && + strlen (tmpbuffer) == strlen (*ret)) + strcpy (*ret, tmpbuffer); + } + } +#endif return ret; } -- cgit v1.2.3