Skip to content

Commit 1495acd

Browse files
committed
Use name instead of absolute path for checking allow/blocklist.
1 parent 51ccf5d commit 1495acd

File tree

2 files changed

+2
-6
lines changed

2 files changed

+2
-6
lines changed

bindgen/ir/context.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2622,7 +2622,7 @@ If you encounter an error missing from this list, please file an issue or a PR!"
26222622
if self
26232623
.options()
26242624
.allowlisted_files
2625-
.matches(file.path().display().to_string())
2625+
.matches(file.name())
26262626
{
26272627
return true;
26282628
}

bindgen/ir/item.rs

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -641,11 +641,7 @@ impl Item {
641641

642642
if !ctx.options().blocklisted_files.is_empty() {
643643
if let Some(SourceLocation::File { file, .. }) = &self.location {
644-
if ctx
645-
.options()
646-
.blocklisted_files
647-
.matches(file.path().display().to_string())
648-
{
644+
if ctx.options().blocklisted_files.matches(file.name()) {
649645
return true;
650646
}
651647
}

0 commit comments

Comments
 (0)