summaryrefslogtreecommitdiff
path: root/external/mythes
diff options
context:
space:
mode:
Diffstat (limited to 'external/mythes')
-rw-r--r--external/mythes/mythes-fdo48017-wfopen.patch9
1 files changed, 7 insertions, 2 deletions
diff --git a/external/mythes/mythes-fdo48017-wfopen.patch b/external/mythes/mythes-fdo48017-wfopen.patch
index 1621b1d35641..82d69ad6626e 100644
--- a/external/mythes/mythes-fdo48017-wfopen.patch
+++ b/external/mythes/mythes-fdo48017-wfopen.patch
@@ -31,7 +31,7 @@ diff -u mythes/mythes.cxx build/mythes/mythes.cxx
if (!pdfile) {
return 0;
}
-@@ -370,3 +375,17 @@
+@@ -373,3 +378,22 @@
return -1;
}
@@ -41,9 +41,14 @@ diff -u mythes/mythes.cxx build/mythes/mythes.cxx
+ if (strncmp(path, WIN32_LONG_PATH_PREFIX, 4) == 0) {
+ int len = MultiByteToWideChar(CP_UTF8, 0, path, -1, NULL, 0);
+ wchar_t *buff = (wchar_t *) malloc(len * sizeof(wchar_t));
++ wchar_t *buff2 = (wchar_t *) malloc(len * sizeof(wchar_t));
++ FILE * f = NULL;
+ MultiByteToWideChar(CP_UTF8, 0, path, -1, buff, len);
-+ FILE * f = _wfopen(buff, (strcmp(mode, "r") == 0) ? L"r" : L"rb");
++ if (_wfullpath( buff2, buff, len ) != NULL) {
++ f = _wfopen(buff2, (strcmp(mode, "r") == 0) ? L"r" : L"rb");
++ }
+ free(buff);
++ free(buff2);
+ return f;
+ }
+#endif