[Libreoffice-commits] core.git: Branch 'libreoffice-4-3' - external/hunspell

László Németh nemeth at numbertext.org
Sat Jul 19 01:34:48 PDT 2014


 external/hunspell/hunspell-fdo48017-wfopen.patch |    9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

New commits:
commit 24e9950f68ca57c454dbb35cf8562d82e76a42e7
Author: László Németh <nemeth at numbertext.org>
Date:   Sat Jul 19 03:44:07 2014 +0200

    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 at collabora.com>
    Tested-by: Andras Timar <andras.timar at collabora.com>
    (cherry picked from commit 7efd83bb29ef8be8c78c4da5452fe3293ed15ea4)
    Reviewed-on: https://gerrit.libreoffice.org/10405

diff --git a/external/hunspell/hunspell-fdo48017-wfopen.patch b/external/hunspell/hunspell-fdo48017-wfopen.patch
index 47b803b..e358106 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


More information about the Libreoffice-commits mailing list