Can't find Windows libraries with .DLL extension in upper case
Ilya33 opened this issue · 5 comments
Ilya33 commented
Hello.
The find_lib function can't find Windows libraries with .DLL extension in upper case.
For example I have Windows7 with COLORCNV.DLL and IPHLPAPI.DLL in C:\Windows\System32.
Code example:
my ($lib) = find_lib(
lib => 'IPHLPAPI',
# lib => 'IPHLPAPI.DLL'
)
# $lib is undefif replace line 91 in FFI/CheckLib.pm
# from
$pattern = [ qr{^(?:lib)?(.*?)(?:-([0-9])+)?\.dll$} ];
# to
$pattern = [ qr{^(?:lib)?(.*?)(?:-([0-9])+)?\.(?i)dll$} ];it resolve the problem.
Maybe exists a better solution
plicease commented
No I think your solution is right. Can you provide a PR with a test?
plicease commented
Actually I think we'd better make the entire regex case insensitive.
plicease commented
FFI-CheckLib-0.21_01.tar.gz should address this. I will make a production release soon if it looks good on cpantesters.
Ilya33 commented
Thank you very much!
plicease commented
fyi- Released this just now as 0.22, which is a production version.