summaryrefslogtreecommitdiff
path: root/Build/source/texk/kpathsea/tex-file.c
diff options
context:
space:
mode:
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;
}