diff options
author | László Németh <nemeth@numbertext.org> | 2014-07-19 03:44:07 +0200 |
---|---|---|
committer | Andras Timar <andras.timar@collabora.com> | 2014-07-19 08:34:21 +0000 |
commit | 24e9950f68ca57c454dbb35cf8562d82e76a42e7 (patch) | |
tree | 4b845c160dc7b3629c4da720200bc7f8b35e9d4e | |
parent | 9451e52b449210a83502b337c6fcc0c240daa576 (diff) |
fdo#80363 add _wfullpath to expand ".." in dictionary paths
Change-Id: I6c9edd0b4d2c63f7735d090e5d2d72d5fb81b921
Reviewed-on: https://gerrit.libreoffice.org/10400
Reviewed-by: Andras Timar <andras.timar@collabora.com>
Tested-by: Andras Timar <andras.timar@collabora.com>
(cherry picked from commit 7efd83bb29ef8be8c78c4da5452fe3293ed15ea4)
Reviewed-on: https://gerrit.libreoffice.org/10405
-rw-r--r-- | external/hunspell/hunspell-fdo48017-wfopen.patch | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/external/hunspell/hunspell-fdo48017-wfopen.patch b/external/hunspell/hunspell-fdo48017-wfopen.patch index 47b803bc6529..e3581062752e 100644 --- a/external/hunspell/hunspell-fdo48017-wfopen.patch +++ b/external/hunspell/hunspell-fdo48017-wfopen.patch @@ -13,7 +13,7 @@ diff -ru hunspell/src/hunspell/csutil.cxx build/hunspell/src/hunspell/csutil.cxx #ifdef OPENOFFICEORG # include <unicode/uchar.h> #else -@@ -46,6 +50,21 @@ +@@ -46,6 +50,26 @@ static struct unicode_info2 * utf_tbl = NULL; static int utf_tbl_count = 0; // utf_tbl can be used by multiple Hunspell instances @@ -23,9 +23,14 @@ diff -ru hunspell/src/hunspell/csutil.cxx build/hunspell/src/hunspell/csutil.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)); + MultiByteToWideChar(CP_UTF8, 0, path, -1, buff, len); -+ FILE * f = _wfopen(buff, (strcmp(mode, "r") == 0) ? L"r" : L"rb"); ++ FILE * f = NULL; ++ if (_wfullpath( buff2, buff, len ) != NULL) { ++ f = _wfopen(buff2, (strcmp(mode, "r") == 0) ? L"r" : L"rb"); ++ } + free(buff); ++ free(buff2); + return f; + } +#endif |