fpc/tests/webtbs/tw14020.pp
Jonas Maebe 25463000ac * do not mark all found files with Find* as "faHidden" if the search path
starts with './' (mantis #14020)
  * also mark files whose name starts with '.' that are found in subdirectories
    as faHidden (not reported, but was due to a similar error)
  - removed some unused variables related to the Find* functionality

git-svn-id: trunk@13307 -
2009-06-21 10:21:06 +00:00

37 lines
728 B
ObjectPascal

{ %target=linux,freebsd,darwin,solaris,haiku }
program project1;
uses
SysUtils;
var
rSearch: TSearchRec;
lsName, lsSearch: String;
bDone: Boolean;
begin
{ for all files in the dir }
lsSearch := './' + AllFilesMask; //fails to find anything
WriteLn(lsSearch);
FillChar(rSearch, Sizeof(TSearchRec), 0);
bDone := (FindFirst(lsSearch, 0, rSearch) <> 0);
while not bDone do
begin
lsName := rSearch.Name;
Assert(lsName <> '');
if (rSearch.Attr and faDirectory > 0) then
continue;
{ if we find one file, it's ok }
findclose(rsearch);
halt(0);
bDone := (FindNext(rSearch) <> 0);
Assert(bDone or (rSearch.Name <> lsName));
end;
FindClose(rSearch);
halt(1);
end.