=?UTF-8?Q?Gabriel=20Iv=C4=83ncescu=20?=: kernel32/locale: Don' t fail with non-NULL args when the Unix codepage falls back to UTF-8.

Alexandre Julliard julliard at winehq.org
Wed Sep 4 16:01:38 CDT 2019


Module: wine
Branch: master
Commit: 6f8bea3049f5194277f7189778732b01e389009e
URL:    https://source.winehq.org/git/wine.git/?a=commit;h=6f8bea3049f5194277f7189778732b01e389009e

Author: Gabriel Ivăncescu <gabrielopcode at gmail.com>
Date:   Wed Sep  4 17:27:24 2019 +0300

kernel32/locale: Don't fail with non-NULL args when the Unix codepage falls back to UTF-8.

Signed-off-by: Gabriel Ivăncescu <gabrielopcode at gmail.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 dlls/kernel32/locale.c | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/dlls/kernel32/locale.c b/dlls/kernel32/locale.c
index 2698b3d..7710cc9 100644
--- a/dlls/kernel32/locale.c
+++ b/dlls/kernel32/locale.c
@@ -2727,9 +2727,13 @@ INT WINAPI WideCharToMultiByte( UINT page, DWORD flags, LPCWSTR src, INT srclen,
             ret = wine_cp_wcstombs( unix_cptable, flags, src, srclen, dst, dstlen,
                                     defchar, used ? &used_tmp : NULL );
             if (used) *used = used_tmp;
-            break;
         }
-        /* fall through */
+        else
+        {
+            ret = wine_utf8_wcstombs( flags, src, srclen, dst, dstlen );
+            if (used) *used = FALSE;
+        }
+        break;
     case CP_UTF8:
         if (defchar || used)
         {




More information about the wine-cvs mailing list