Commit f2ca35bd authored by Eric Pouech's avatar Eric Pouech Committed by Alexandre Julliard

cmd: Use OEM code page when reading a file.

Calling GetConsoleCP() when ReadConsoleW() fails (potentially indicating that cmd.exe's instance isn't attached to a console) makes no sense. In details, since GetConsoleCP() returns 0 when not attached to a console to indicate error, we're in fact using CP_ACP. So fallback explicitely to OEM CP (which is the default for CUI programs). Signed-off-by: 's avatarEric Pouech <eric.pouech@gmail.com>
parent 1c30f780
...@@ -255,7 +255,7 @@ WCHAR *WCMD_fgets(WCHAR *buf, DWORD noChars, HANDLE h) ...@@ -255,7 +255,7 @@ WCHAR *WCMD_fgets(WCHAR *buf, DWORD noChars, HANDLE h)
UINT cp; UINT cp;
const char *p; const char *p;
cp = GetConsoleCP(); cp = GetOEMCP();
bufA = heap_xalloc(noChars); bufA = heap_xalloc(noChars);
/* Save current file position */ /* Save current file position */
......
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