[fpc-devel] [Go32v2] LFN FindFirst bug

Marco Borsari borsa77 at libero.it
Tue Feb 28 20:50:21 CET 2012


Hi all,
on system with long file name support activated (I have FreeDos with 
doslfn), the example below types all files instead of directory only.

program test;
uses dos;
var f:searchrec;
begin
findfirst('*',directory,f);
while doserror=0 do begin
writeln(f.name);
findnext(f);
end;
findclose(f);
end.

Looking at the Ralph Brown's list I found the problem which arises as 
the attribute value must be loaded twice in the cx register in his low 
and high halves for (respectively) the allowable and required search 
criteria. Changes to accomplish that are in the diff attached, $37 is 
AnyFile constant cleared of the volume label bit.
A total different point: in the zip file of the source of the compiler 
all texts are in the Unix end line format, the result are broken 
recompilation process on Dos'es. Maybe it would be better to convert it, 
Info-Zip has a specific option during compression.
Marco
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: lfn.dif
URL: <http://lists.freepascal.org/pipermail/fpc-devel/attachments/20120228/e9ef03d8/attachment.ksh>


More information about the fpc-devel mailing list