Browse Source

* FSearch under OS/2 fixed

Tomas Hajny 26 years ago
parent
commit
42890bf082
1 changed files with 22 additions and 6 deletions
  1. 22 6
      rtl/os2/dos.pas

+ 22 - 6
rtl/os2/dos.pas

@@ -4,7 +4,7 @@
 
 
                          Free Pascal Runtime-Library
                          Free Pascal Runtime-Library
                               DOS unit for OS/2
                               DOS unit for OS/2
-                   Copyright (c) 1997,1998 by Danil Mantione,
+                   Copyright (c) 1997,1998 by Daniel Mantione,
                    member of the Free Pascal development team
                    member of the Free Pascal development team
 
 
     See the file COPYING.FPC, included in this distribution,
     See the file COPYING.FPC, included in this distribution,
@@ -18,8 +18,6 @@
 
 
 unit dos;
 unit dos;
 
 
-{$I os.inc}
-
 {$ASMMODE ATT}
 {$ASMMODE ATT}
 
 
 {***************************************************************************}
 {***************************************************************************}
@@ -179,6 +177,9 @@ function fsearch(path:pathstr;dirlist:string):pathstr;
 var i,p1:longint;
 var i,p1:longint;
     s:searchrec;
     s:searchrec;
     newdir:pathstr;
     newdir:pathstr;
+    RC, Handle, Count: longint;
+    FStat: PFileFindBuf3;
+    ND: PathStr;
 
 
 begin
 begin
     {No wildcards allowed in these things:}
     {No wildcards allowed in these things:}
@@ -204,8 +205,20 @@ begin
                 if (newdir<>'') and
                 if (newdir<>'') and
                  not (newdir[length(newdir)] in ['\',':']) then
                  not (newdir[length(newdir)] in ['\',':']) then
                     newdir:=newdir+'\';
                     newdir:=newdir+'\';
-                findfirst(newdir+path,anyfile,s);
-                if doserror=0 then
+                if OS_Mode = osOS2 then
+                begin
+                 New (FStat);
+                 ND := NewDir + Path;
+                 RC := DosFindFirst (ND, Handle, $39, FStat, SizeOf (FStat^),
+                                                            Count, ilStandard);
+                 DosFindClose (Handle);
+                 Dispose (FStat);
+                end else
+                begin
+                 findfirst(newdir+path,anyfile,s);
+                 RC := DosError;
+                end;
+                if RC = 0 then
                     newdir:=newdir+path
                     newdir:=newdir+path
                 else
                 else
                     newdir:='';
                     newdir:='';
@@ -985,7 +998,10 @@ end;
 end.
 end.
 {
 {
   $Log$
   $Log$
-  Revision 1.12  1999-01-22 16:25:58  pierre
+  Revision 1.13  1999-09-09 09:20:43  hajny
+    * FSearch under OS/2 fixed
+
+  Revision 1.12  1999/01/22 16:25:58  pierre
    + findclose added
    + findclose added
 
 
   Revision 1.11  1999/01/18 16:22:51  jonas
   Revision 1.11  1999/01/18 16:22:51  jonas