Procházet zdrojové kódy

Merged revisions 2684 via svnmerge from
http://[email protected]/svn/fpc/trunk

........
r2684 | hajny | 2006-02-26 00:28:26 +0000 (Sun, 26 Feb 2006) | 1 line

* fix for buggy FileExists and DirectoryExists
........

git-svn-id: branches/fixes_2_0@2686 -

Tomas Hajny před 19 roky
rodič
revize
cc93cbb2c5
1 změnil soubory, kde provedl 4 přidání a 2 odebrání
  1. 4 2
      rtl/os2/sysutils.pp

+ 4 - 2
rtl/os2/sysutils.pp

@@ -549,7 +549,8 @@ var
   RC: longint;
 begin
   FileExists:=False;
-  if FindFirst (FileName, faAnyFile, SR)=0 then FileExists:=True;
+  if FindFirst (FileName, faAnyFile and not (faDirectory), SR) = 0
+    then FileExists := True;
   FindClose(SR);
 end;
 
@@ -768,7 +769,8 @@ function DirectoryExists (const Directory: string): boolean;
 var
   SR: TSearchRec;
 begin
-  DirectoryExists:=FindFirst(Directory, faDirectory, SR)=0;
+  DirectoryExists := (FindFirst (Directory, faAnyFile, SR) = 0) and
+                                                (SR.Attr and faDirectory <> 0);
   FindClose(SR);
 end;