Selaa lähdekoodia

Check that restoration of start directory (for go32v2 OS) is successful and report if it is not

Pierre Muller 1 viikko sitten
vanhempi
commit
6f905466f3
1 muutettua tiedostoa jossa 9 lisäystä ja 1 poistoa
  1. 9 1
      packages/ide/fp.pas

+ 9 - 1
packages/ide/fp.pas

@@ -372,7 +372,9 @@ const bullet=#254;
 { For DOS in program active current directory is actual system current }
 { directory. Have to save and restore on exit.                         }
 {$ifdef go32v2}
-var DirectoryInvokeFpFrom : String;
+var
+  DirectoryInvokeFpFrom : String;
+  ChDirRes : Word;
 {$endif}
 
 var
@@ -625,7 +627,13 @@ BEGIN
   SetConsoleMode(GetStdHandle(cardinal(Std_Input_Handle)),StartupConsoleMode);
 {$endif defined(windows)}
 {$ifdef go32v2}
+  {$push}
+  {$i-}
   ChDir(DirectoryInvokeFpFrom); {restore active directory we invoke fp from }
+  ChDirRes:=IOResult;
+  if (ChDirRes<>0) then
+    writeln('Failed to restore start up directory ',DirectoryInvokeFpFrom,' error=',ChDirRes);
+  {$pop}
 {$endif}
   StreamError:=nil;
 {$ifdef DEBUG}