From 24e9950f68ca57c454dbb35cf8562d82e76a42e7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?L=C3=A1szl=C3=B3=20N=C3=A9meth?= Date: Sat, 19 Jul 2014 03:44:07 +0200 Subject: fdo#80363 add _wfullpath to expand ".." in dictionary paths Change-Id: I6c9edd0b4d2c63f7735d090e5d2d72d5fb81b921 Reviewed-on: https://gerrit.libreoffice.org/10400 Reviewed-by: Andras Timar Tested-by: Andras Timar (cherry picked from commit 7efd83bb29ef8be8c78c4da5452fe3293ed15ea4) Reviewed-on: https://gerrit.libreoffice.org/10405 --- external/hunspell/hunspell-fdo48017-wfopen.patch | 9 +++++++-- 1 file 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 #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 -- cgit v1.2.1