diff options
author | Melody Horn <melody@boringcactus.com> | 2024-12-17 21:15:34 -0700 |
---|---|---|
committer | Melody Horn <melody@boringcactus.com> | 2024-12-17 21:15:34 -0700 |
commit | fc6f64a92e00bf97dcb5b6ea4e7a4a6eca190f03 (patch) | |
tree | 16396fd6e5e1294b70e92251a74e9c2e6270c8ad /src | |
parent | b59dcd1cf227345fce63a4202a5c10e21e7e29bd (diff) | |
download | makers-fc6f64a92e00bf97dcb5b6ea4e7a4a6eca190f03.tar.gz makers-fc6f64a92e00bf97dcb5b6ea4e7a4a6eca190f03.zip |
don't irreversibly strip a leading ./ in get_target
Diffstat (limited to 'src')
-rw-r--r-- | src/makefile/mod.rs | 6 |
1 files changed, 5 insertions, 1 deletions
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 |