From fc6f64a92e00bf97dcb5b6ea4e7a4a6eca190f03 Mon Sep 17 00:00:00 2001 From: Melody Horn Date: Tue, 17 Dec 2024 21:15:34 -0700 Subject: don't irreversibly strip a leading ./ in get_target --- src/makefile/mod.rs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/makefile/mod.rs b/src/makefile/mod.rs index c37e948..d746ed1 100644 --- a/src/makefile/mod.rs +++ b/src/makefile/mod.rs @@ -303,7 +303,11 @@ impl<'a> Makefile<'a> { let follow_gnu = cfg!(feature = "full"); #[cfg(feature = "full")] - let name = name.strip_prefix("./").unwrap_or(name); + if let Some(name_without_leading_dot_slash) = name.strip_prefix("./") { + if let Ok(result) = self.get_target(name_without_leading_dot_slash) { + return Ok(result); + } + } let exists_but_infer_anyway = if follow_gnu { self.targets -- cgit v1.2.3