summaryrefslogtreecommitdiff
path: root/Build/source/texk/kpathsea/tex-file.c
diff options
context:
space:
mode:
authorAkira Kakuto <kakuto@fuk.kindai.ac.jp>2017-09-20 06:58:43 +0000
committerAkira Kakuto <kakuto@fuk.kindai.ac.jp>2017-09-20 06:58:43 +0000
commitfaa0cebb8ae3c94b13b51ff2136bc682f746028d (patch)
tree386e46aeced0266728ec2b21345755d466c45ecd /Build/source/texk/kpathsea/tex-file.c
parentf80eaf5522348819891dabd80006a77d653dea90 (diff)
kpathsea: Fix to return actual file names (W32 only)
git-svn-id: svn://tug.org/texlive/trunk@45352 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Build/source/texk/kpathsea/tex-file.c')
-rw-r--r--Build/source/texk/kpathsea/tex-file.c19
1 files changed, 18 insertions, 1 deletions
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;
}