Skip to content

Commit bcff594

Browse files
Ecordonnierxtqqczze
andcommitted
Update src/uu/stdbuf/build.rs
Co-authored-by: xtqqczze <45661989+xtqqczze@users.noreply.github.com>
1 parent 8c229c6 commit bcff594

1 file changed

Lines changed: 2 additions & 3 deletions

File tree

src/uu/stdbuf/build.rs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -90,9 +90,8 @@ fn main() {
9090
// OUT_DIR is always .../target/[triple/]{profile}/build/{pkg-hash}/out, so the profile
9191
// is exactly 3 parent levels up — regardless of whether a target triple is in the path.
9292
let profile = Path::new(&out_dir)
93-
.parent() // .../build/{pkg-hash}
94-
.and_then(|p| p.parent()) // .../build
95-
.and_then(|p| p.parent()) // .../{profile}
93+
.ancestors()
94+
.nth(3)
9695
.and_then(|p| p.file_name())
9796
.and_then(|s| s.to_str())
9897
.unwrap_or("debug");

0 commit comments

Comments
 (0)