Kaydet (Commit) d7374d48 authored tarafından László Németh's avatar László Németh

fdo#80363 _wfullpath in MyThes and Hyphen

Change-Id: I4232040d4c62220389ca356797d18b1c87673e64
üst f6d7e7bb
...@@ -13,7 +13,7 @@ diff -ru hunspell/src/hunspell/csutil.cxx build/hunspell/src/hunspell/csutil.cxx ...@@ -13,7 +13,7 @@ diff -ru hunspell/src/hunspell/csutil.cxx build/hunspell/src/hunspell/csutil.cxx
#ifdef OPENOFFICEORG #ifdef OPENOFFICEORG
# include <unicode/uchar.h> # include <unicode/uchar.h>
#else #else
@@ -46,6 +50,26 @@ @@ -51,6 +51,26 @@
static struct unicode_info2 * utf_tbl = NULL; static struct unicode_info2 * utf_tbl = NULL;
static int utf_tbl_count = 0; // utf_tbl can be used by multiple Hunspell instances 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 ...@@ -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); + int len = MultiByteToWideChar(CP_UTF8, 0, path, -1, NULL, 0);
+ wchar_t *buff = (wchar_t *) malloc(len * sizeof(wchar_t)); + wchar_t *buff = (wchar_t *) malloc(len * sizeof(wchar_t));
+ wchar_t *buff2 = (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; + FILE * f = NULL;
+ MultiByteToWideChar(CP_UTF8, 0, path, -1, buff, len);
+ if (_wfullpath( buff2, buff, len ) != NULL) { + if (_wfullpath( buff2, buff, len ) != NULL) {
+ f = _wfopen(buff2, (strcmp(mode, "r") == 0) ? L"r" : L"rb"); + f = _wfopen(buff2, (strcmp(mode, "r") == 0) ? L"r" : L"rb");
+ } + }
+ free(buff); + free(buff);
+ free(buff2); + free(buff2);
+ return f; + return f;
......
...@@ -13,7 +13,7 @@ diff -u hyphen/hyphen.c build/hyphen/hyphen.c ...@@ -13,7 +13,7 @@ diff -u hyphen/hyphen.c build/hyphen/hyphen.c
#define noVERBOSE #define noVERBOSE
/* calculate hyphenmin values with long ligature length (2 or 3 characters /* 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 ...@@ -23,10 +23,14 @@ diff -u hyphen/hyphen.c build/hyphen/hyphen.c
+ if (strncmp(path, WIN32_LONG_PATH_PREFIX, 4) == 0) { + if (strncmp(path, WIN32_LONG_PATH_PREFIX, 4) == 0) {
+ int len = MultiByteToWideChar(CP_UTF8, 0, path, -1, NULL, 0); + int len = MultiByteToWideChar(CP_UTF8, 0, path, -1, NULL, 0);
+ wchar_t *buff = (wchar_t *) malloc(len * sizeof(wchar_t)); + 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); + 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(buff);
+ free(buff2);
+ return f; + return f;
+ } + }
+#endif +#endif
......
...@@ -31,7 +31,7 @@ diff -u mythes/mythes.cxx build/mythes/mythes.cxx ...@@ -31,7 +31,7 @@ diff -u mythes/mythes.cxx build/mythes/mythes.cxx
if (!pdfile) { if (!pdfile) {
return 0; return 0;
} }
@@ -370,3 +375,17 @@ @@ -373,3 +378,22 @@
return -1; return -1;
} }
...@@ -41,9 +41,14 @@ diff -u mythes/mythes.cxx build/mythes/mythes.cxx ...@@ -41,9 +41,14 @@ diff -u mythes/mythes.cxx build/mythes/mythes.cxx
+ if (strncmp(path, WIN32_LONG_PATH_PREFIX, 4) == 0) { + if (strncmp(path, WIN32_LONG_PATH_PREFIX, 4) == 0) {
+ int len = MultiByteToWideChar(CP_UTF8, 0, path, -1, NULL, 0); + int len = MultiByteToWideChar(CP_UTF8, 0, path, -1, NULL, 0);
+ wchar_t *buff = (wchar_t *) malloc(len * sizeof(wchar_t)); + 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); + 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(buff);
+ free(buff2);
+ return f; + return f;
+ } + }
+#endif +#endif
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment