Ver Fonte

atari: fixed file opening, we can now read text files at least on this platform

git-svn-id: trunk@34696 -
Károly Balogh há 8 anos atrás
pai
commit
63166555a2
1 ficheiros alterados com 8 adições e 2 exclusões
  1. 8 2
      rtl/atari/sysfile.inc

+ 8 - 2
rtl/atari/sysfile.inc

@@ -222,13 +222,19 @@ begin
   if (flags and $1000)<>0 then
     dosResult:=gemdos_fcreate(p,0)
   else
-    dosResult:=gemdos_fopen(p,filerec(f).mode);
+    dosResult:=gemdos_fopen(p,flags and 3);
 
   if oldp<>p then
     freemem(p);
 
   if dosResult < 0 then
-    Error2InOutRes(dosResult);
+    begin
+      Error2InOutRes(dosResult);
+      filerec(f).mode:=fmClosed;
+      exit;
+    end
+  else
+    filerec(f).handle:=handle;
 
   { append mode }
   if ((Flags and $100)<>0) and