=?UTF-8?Q?Rafa=C5=82=20Mu=C5=BCy=C5=82o=20?=: itss: Fix handling non-ASCII content paths.

Alexandre Julliard julliard at winehq.org
Tue Sep 12 15:40:39 CDT 2017


Module: wine
Branch: master
Commit: f4fe2b2dc8fe88308a16381b7ca8156e63ab056b
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=f4fe2b2dc8fe88308a16381b7ca8156e63ab056b

Author: Rafał Mużyło <galtgendo at o2.pl>
Date:   Tue Sep 12 19:09:04 2017 +0200

itss: Fix handling non-ASCII content paths.

Signed-off-by: Rafał Mużyło <galtgendo at o2.pl>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 dlls/itss/chm_lib.c | 13 ++++---------
 1 file changed, 4 insertions(+), 9 deletions(-)

diff --git a/dlls/itss/chm_lib.c b/dlls/itss/chm_lib.c
index f258623..829f758 100644
--- a/dlls/itss/chm_lib.c
+++ b/dlls/itss/chm_lib.c
@@ -935,15 +935,10 @@ static UInt64 _chm_parse_cword(UChar **pEntry)
 /* parse a utf-8 string into an ASCII char buffer */
 static BOOL _chm_parse_UTF8(UChar **pEntry, UInt64 count, WCHAR *path)
 {
-    /* MJM - Modified to return real Unicode strings */ 
-    while (count != 0)
-    {
-        *path++ = (*(*pEntry)++);
-        --count;
-    }
-
-    *path = '\0';
-    return TRUE;
+    DWORD length = MultiByteToWideChar(CP_UTF8, 0, (char *)*pEntry, count, path, CHM_MAX_PATHLEN);
+    path[length] = '\0';
+    *pEntry += count;
+    return !!length;
 }
 
 /* parse a PMGL entry into a chmUnitInfo struct; return 1 on success. */




More information about the wine-cvs mailing list