summaryrefslogtreecommitdiff
path: root/external
diff options
context:
space:
mode:
authorLászló Németh <nemeth@numbertext.org>2014-07-20 13:46:57 +0200
committerAndras Timar <andras.timar@collabora.com>2014-07-21 06:48:10 +0000
commit0ad283adb51b3a1bb777e6341e61541d4bffaa44 (patch)
tree6adbde0f3a71d194922edb22aed4c08bfe0fc8dd /external
parent2762bb1b1b57d0eec2d8cd2c092e52ef082c50b6 (diff)
fdo#80363 _wfullpath in MyThes and Hyphen
(cherry-picked from commit d7374d4812316a79916956f03c8bd4a281fdbdec) Conflicts: external/hyphen/hyphen-fdo48017-wfopen.patch Change-Id: I4232040d4c62220389ca356797d18b1c87673e64 Reviewed-on: https://gerrit.libreoffice.org/10422 Reviewed-by: Andras Timar <andras.timar@collabora.com> Tested-by: Andras Timar <andras.timar@collabora.com>
Diffstat (limited to 'external')
-rw-r--r--external/hunspell/hunspell-fdo48017-wfopen.patch6
-rw-r--r--external/hyphen/hyphen-fdo48017-wfopen.patch12
-rw-r--r--external/mythes/mythes-fdo48017-wfopen.patch9
3 files changed, 18 insertions, 9 deletions
diff --git a/external/hunspell/hunspell-fdo48017-wfopen.patch b/external/hunspell/hunspell-fdo48017-wfopen.patch
index e3581062752e..37203be5c3f9 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,26 @@
+@@ -51,6 +51,26 @@
static struct unicode_info2 * utf_tbl = NULL;
static int utf_tbl_count = 0; // utf_tbl can be used by multiple Hunspell instances
@@ -24,11 +24,11 @@ diff -ru hunspell/src/hunspell/csutil.cxx build/hunspell/src/hunspell/csutil.cxx
+ 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 = NULL;
++ MultiByteToWideChar(CP_UTF8, 0, path, -1, buff, len);
+ if (_wfullpath( buff2, buff, len ) != NULL) {
+ f = _wfopen(buff2, (strcmp(mode, "r") == 0) ? L"r" : L"rb");
-+ }
++ }
+ free(buff);
+ free(buff2);
+ return f;
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;
diff --git a/external/mythes/mythes-fdo48017-wfopen.patch b/external/mythes/mythes-fdo48017-wfopen.patch
index 1621b1d35641..82d69ad6626e 100644
--- a/external/mythes/mythes-fdo48017-wfopen.patch
+++ b/external/mythes/mythes-fdo48017-wfopen.patch
@@ -31,7 +31,7 @@ diff -u mythes/mythes.cxx build/mythes/mythes.cxx
if (!pdfile) {
return 0;
}
-@@ -370,3 +375,17 @@
+@@ -373,3 +378,22 @@
return -1;
}
@@ -41,9 +41,14 @@ diff -u mythes/mythes.cxx build/mythes/mythes.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));
++ FILE * f = NULL;
+ MultiByteToWideChar(CP_UTF8, 0, path, -1, buff, len);
-+ FILE * 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