diff options
Diffstat (limited to 'external/hyphen/hyphen-fdo48017-wfopen.patch')
-rw-r--r-- | external/hyphen/hyphen-fdo48017-wfopen.patch | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/external/hyphen/hyphen-fdo48017-wfopen.patch b/external/hyphen/hyphen-fdo48017-wfopen.patch index 27cffa08703c..e99a89161f2a 100644 --- a/external/hyphen/hyphen-fdo48017-wfopen.patch +++ b/external/hyphen/hyphen-fdo48017-wfopen.patch @@ -13,7 +13,7 @@ diff -u hyphen/hyphen.c build/hyphen/hyphen.c #define noVERBOSE /* calculate hyphenmin values with long ligature length (2 or 3 characters -@@ -371,6 +376,22 @@ +@@ -371,6 +376,26 @@ } } @@ -23,10 +23,14 @@ diff -u hyphen/hyphen.c build/hyphen/hyphen.c + 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)); -+ FILE * f; ++ wchar_t *buff2 = (wchar_t *) malloc(len * sizeof(wchar_t)); ++ FILE * f = NULL; + MultiByteToWideChar(CP_UTF8, 0, path, -1, buff, len); -+ 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 @@ -36,7 +40,7 @@ diff -u hyphen/hyphen.c build/hyphen/hyphen.c HyphenDict * hnj_hyphen_load (const char *fn) { -@@ -383,7 +404,7 @@ +@@ -383,7 +408,7 @@ HashEntry *e; int state_num = 0; |