summaryrefslogtreecommitdiff
path: root/Build/source/texk
diff options
context:
space:
mode:
authorAkira Kakuto <kakuto@fuk.kindai.ac.jp>2017-11-11 08:54:52 +0000
committerAkira Kakuto <kakuto@fuk.kindai.ac.jp>2017-11-11 08:54:52 +0000
commit85077b55014839bf9505aaadef288fc817167657 (patch)
tree04dff008e96c1c6dacbe3d4492c8c805ddc96467 /Build/source/texk
parent5dc224e1615426c46c049f66102c4386320b08d9 (diff)
tex-file.c: Again use a custom kpathsea_getlongpath() instead of GetLongPathName() (W32 only).
git-svn-id: svn://tug.org/texlive/trunk@45750 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Build/source/texk')
-rw-r--r--Build/source/texk/kpathsea/ChangeLog6
-rw-r--r--Build/source/texk/kpathsea/tex-file.c25
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);
}
}
}