Explorar el Código

* fix for wrong behaviour of SetSafeCPSwitching

git-svn-id: trunk@37709 -
Tomas Hajny hace 7 años
padre
commit
f4b0a46620
Se han modificado 1 ficheros con 5 adiciones y 4 borrados
  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);
 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);