KyleMayes / clang-sys

Rust bindings for libclang.
Apache License 2.0
128 stars 65 forks source link

Return unescaped paths when searching for library files #176

Closed aliu closed 1 month ago

aliu commented 1 month ago

There is a bug in #134 where search_directory returned the escaped directory, which causes errors when it is later passed to File::open.

One can reproduce the issue by creating a project using bindgen and setting LIBCLANG_PATH to a folder containing square brackets (e.g. /path/to/[foo]bar). clang-sys is able to find the shared libraries inside the [foo]bar folder but is unable to actually load the files because the path becomes /path/to/[[]foo[]]bar/libclang.so.

KyleMayes commented 1 month ago

Thanks for the contribution!

aliu commented 1 month ago

Happy to help! Any chance we could get a 1.7.1 release with this fix included? 😁

KyleMayes commented 1 month ago

Sure, I should have a release out in a few hours (going to look into a few more issues).

KyleMayes commented 1 month ago

Just released v1.8.0 with this change.