diff options
Diffstat (limited to 'Build/source/texk')
-rw-r--r-- | Build/source/texk/kpathsea/ChangeLog | 6 | ||||
-rw-r--r-- | Build/source/texk/kpathsea/tex-file.c | 25 |
2 files changed, 19 insertions, 12 deletions
diff --git a/Build/source/texk/kpathsea/ChangeLog b/Build/source/texk/kpathsea/ChangeLog index 1acc00dd981..c05a72df8f2 100644 --- a/Build/source/texk/kpathsea/ChangeLog +++ b/Build/source/texk/kpathsea/ChangeLog @@ -1,3 +1,9 @@ +2017-11-11 Akira Kakuto <kakuto@fuk.kindai.ac.jp> + + * tex-file.c: Again use a custom kpathsea_getlongpath() + instead of a standard API function GetLongPathName(), since + the latter sometimes does not work as desired (W32 only). + 2017-11-09 Karl Berry <karl@freefriends.org> * db.c (kpathsea_db_search_list): remove redundant test of `found'. diff --git a/Build/source/texk/kpathsea/tex-file.c b/Build/source/texk/kpathsea/tex-file.c index 4684b0c7a52..74275de955c 100644 --- a/Build/source/texk/kpathsea/tex-file.c +++ b/Build/source/texk/kpathsea/tex-file.c @@ -1011,8 +1011,8 @@ kpathsea_find_file_generic (kpathsea kpse, const_string const_name, kpse_file_format_type format, boolean must_exist, boolean all) { -#if defined(_WIN32) - char tmpbuffer[512]; +#if defined(_WIN32) && !defined(__MINGW32__) + char tmpbuffer1[512], tmpbuffer2[512]; #endif string *target, name; const_string *ext; @@ -1136,22 +1136,23 @@ kpathsea_find_file_generic (kpathsea kpse, const_string const_name, } free (name); -#if defined(_WIN32) +#if defined(_WIN32) && !defined(__MINGW32__) if (ret && *ret) { - size_t cplen; if (all) { for (count = 0; ret[count] != NULL; count++) { - if ((cplen = GetLongPathName (ret[count], tmpbuffer, 500))) { - if (cplen > strlen (ret[count])) - ret[count] = realloc (ret[count], cplen + 1); - strcpy (ret[count], tmpbuffer); + strcpy (tmpbuffer2, ret[count]); + if (kpathsea_getlongpath (kpse, tmpbuffer1, tmpbuffer2, 500)) { + if (strlen (tmpbuffer1) > strlen (ret[count])) + ret[count] = realloc (ret[count], strlen (tmpbuffer1) + 1); + strcpy (ret[count], tmpbuffer1); } } } else { - if ((cplen = GetLongPathName (*ret, tmpbuffer, 500))) { - if (cplen > strlen (*ret)) - *ret = realloc (*ret, cplen + 1); - strcpy (*ret, tmpbuffer); + strcpy (tmpbuffer2, *ret); + if (kpathsea_getlongpath (kpse, tmpbuffer1, tmpbuffer2, 500)) { + if (strlen (tmpbuffer1) > strlen (*ret)) + *ret = realloc (*ret, strlen (tmpbuffer1) + 1); + strcpy (*ret, tmpbuffer1); } } } |