16 Oct
2012
16 Oct
'12
6:45 p.m.
Akihiro Sagawa <sagawa.aki(a)gmail.com> writes:
@@ -244,7 +244,8 @@ WCHAR *WCMD_fgets(WCHAR *buf, DWORD noChars, HANDLE h)
if (!WCMD_is_console_handle(h) && i != charsRead) { /* Sets file pointer to the start of the next line, if any */ - filepos.QuadPart += i + 1 + (buf[i] == '\r' ? 1 : 0); + INT bytes = WideCharToMultiByte(GetConsoleCP(), 0, buf, i, NULL, 0, NULL, NULL); + filepos.QuadPart += bytes + 1 + (buf[i] == '\r' ? 1 : 0);
There's no guarantee that all characters would round-trip properly, this should be based on the original multibyte length somehow. -- Alexandre Julliard julliard(a)winehq.org