浏览代码

* fix for wrong behaviour of SetSafeCPSwitching

git-svn-id: trunk@37709 -
Tomas Hajny 7 年之前
父节点
当前提交
f4b0a46620
共有 1 个文件被更改,包括 5 次插入4 次删除
  1. 5 4
      packages/rtl-console/src/win/crt.pp

+ 5 - 4
packages/rtl-console/src/win/crt.pp

@@ -122,13 +122,14 @@ end;
 procedure SetUseACP(ACP:Boolean);
 procedure SetUseACP(ACP:Boolean);
 begin
 begin
     UseACP:=ACP;
     UseACP:=ACP;
-    if UseACP then
-      if not(SafeCPSwitching) then
+    if not(SafeCPSwitching) then
+     begin
+      if UseACP then
         SetConsoleOutputCP(GetACP)   // Set console CP only once here if SafeCPSwitching is False and
         SetConsoleOutputCP(GetACP)   // Set console CP only once here if SafeCPSwitching is False and
                                      // if UseACP is True
                                      // if UseACP is True
       else
       else
-       SetConsoleOutputCP(OriginalConsoleOutputCP)    // Set console back to original if UseACP is False
-    else
+        SetConsoleOutputCP(OriginalConsoleOutputCP)    // Set console back to original if UseACP is False
+     end;
 end;
 end;
 
 
 procedure TextMode (Mode: word);
 procedure TextMode (Mode: word);