enzo1982 / BoCA

A component library used by the fre:ac audio converter
https://www.freac.org/
GNU General Public License v2.0
37 stars 9 forks source link

Fix CoreAudio DLL path not being found (on newer Wine?) #15

Open udf opened 8 months ago

udf commented 8 months ago

FindFirstFile considers a path with a trailing backslash as invalid:

This parameter should not be NULL, an invalid string (for example, an empty string or a string that is missing the terminating null character), or end in a trailing backslash ().

It seems the trailing backslash used to be fine on older versions of Wine, but it has since been fixed.

This could be resolved by trimming the backslash, but I think it's better to use PathFileExists instead, which "Determines whether a path to a file system object such as a file or folder is valid.".

I have not tested the changes on Windows, however (but if the Microsoft Documentation is to be believed then it shouldn't have worked before).