2
0
Эх сурвалжийг харах

* fix for wrong behaviour of SetSafeCPSwitching

git-svn-id: trunk@37709 -
Tomas Hajny 7 жил өмнө
parent
commit
f4b0a46620

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

@@ -122,13 +122,14 @@ end;
 procedure SetUseACP(ACP:Boolean);
 begin
     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
                                      // if UseACP is True
       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;
 
 procedure TextMode (Mode: word);