Hugh McMaster : chcp: Print the active code page after successfully setting the new one.

Alexandre Julliard julliard at winehq.org
Wed Nov 24 15:17:19 CST 2021


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

Author: Hugh McMaster <hugh.mcmaster at outlook.com>
Date:   Tue Nov 23 23:41:39 2021 +1100

chcp: Print the active code page after successfully setting the new one.

Signed-off-by: Hugh McMaster <hugh.mcmaster at outlook.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 programs/chcp.com/main.c | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/programs/chcp.com/main.c b/programs/chcp.com/main.c
index 5b3486a4366..cc64e044b06 100644
--- a/programs/chcp.com/main.c
+++ b/programs/chcp.com/main.c
@@ -102,10 +102,11 @@ int __cdecl wmain(int argc, WCHAR *argv[])
         int codepage = _wtoi(argv[1]);
         int success = SetConsoleCP(codepage) && SetConsoleOutputCP(codepage);
 
-        if (!success)
-        {
+        if (success)
+            output_message(STRING_ACTIVE_CODE_PAGE, codepage);
+        else
             output_message(STRING_INVALID_CODE_PAGE);
-        }
+
         return !success;
     }
 




More information about the wine-cvs mailing list