diff options
author | Akira Kakuto <kakuto@fuk.kindai.ac.jp> | 2017-09-20 06:58:43 +0000 |
---|---|---|
committer | Akira Kakuto <kakuto@fuk.kindai.ac.jp> | 2017-09-20 06:58:43 +0000 |
commit | faa0cebb8ae3c94b13b51ff2136bc682f746028d (patch) | |
tree | 386e46aeced0266728ec2b21345755d466c45ecd | |
parent | f80eaf5522348819891dabd80006a77d653dea90 (diff) |
kpathsea: Fix to return actual file names (W32 only)
git-svn-id: svn://tug.org/texlive/trunk@45352 c570f23f-e606-0410-a88d-b1316a301751
-rw-r--r-- | Build/source/texk/kpathsea/ChangeLog | 4 | ||||
-rw-r--r-- | Build/source/texk/kpathsea/tex-file.c | 19 |
2 files changed, 22 insertions, 1 deletions
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 <kakuto@fuk.kindai.ac.jp> + + * tex-file.c: Fix to return actual file names (W32 only). + 2017-09-19 Akira Kakuto <kakuto@fuk.kindai.ac.jp> * 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; } |