[fpc-devel]UnixUtil.FNMatch bug

Michalis Kamburelis michalis at camelot.homedns.org
Thu May 6 05:00:11 CEST 2004


I found some bugs in UnixUtil.FNMatch function. In short, patterns like 
'*~' matched anything (instead of matching only filenames ending with 
'~'). I'm attaching patch "unixutil.patch" that fixes these issues. I'm 
also attaching a test program, "fnmatch_test.pas", so you can see that 
these bugs really occur and this patch really fixes them. You may want 
to include this test program somewhere in FPC tests/ dir (tests/test/ 
?). This test program is heavily commented, hopefully it explains 
exactly what bugs were present in FNMatch implementation and why it's OK 

Note to FPC 1.0.10 users: you can use this patch to fix these issues for 
FPC 1.0.10 too. You have to apply this to rtl/unix/linux.pp file. Oh, 
and the test program is usable under FPC 1.0.10 too.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: fnmatch_test.pas
Type: text/x-pascal
Size: 2877 bytes
Desc: not available
URL: <http://lists.freepascal.org/pipermail/fpc-devel/attachments/20040506/cb47d62c/attachment.pas>
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: unixutil.patch
URL: <http://lists.freepascal.org/pipermail/fpc-devel/attachments/20040506/cb47d62c/attachment.ksh>

More information about the fpc-devel mailing list