diff options
author | László Németh <nemeth@numbertext.org> | 2014-07-20 13:46:57 +0200 |
---|---|---|
committer | László Németh <nemeth@numbertext.org> | 2014-07-20 13:46:57 +0200 |
commit | d7374d4812316a79916956f03c8bd4a281fdbdec (patch) | |
tree | 954202487dc8ec731694f2c22e8f4fad28f2bac0 /external/hyphen | |
parent | f6d7e7bb451b3740b4381df3d993769aac961911 (diff) |
fdo#80363 _wfullpath in MyThes and Hyphen
Change-Id: I4232040d4c62220389ca356797d18b1c87673e64
Diffstat (limited to 'external/hyphen')
-rw-r--r-- | external/hyphen/hyphen-fdo48017-wfopen.patch | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/external/hyphen/hyphen-fdo48017-wfopen.patch b/external/hyphen/hyphen-fdo48017-wfopen.patch index 4bcf6335ac2a..815eeda79a37 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,12 +376,28 @@ +@@ -371,12 +376,32 @@ } } @@ -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 |