Skip to content

Commit a01c5dd

Browse files
author
Jon Gjengset
committed
Ignore empty rustflags
1 parent fa7c5b1 commit a01c5dd

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/cargo/core/compiler/build_context/target_info.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -599,7 +599,10 @@ fn env_args(
599599
// First try CARG_ENCODED_RUSTFLAGS from the environment.
600600
// Prefer this over RUSTFLAGS since it's less prone to encoding errors.
601601
if let Ok(a) = env::var(format!("CARGO_ENCODED_{}", name)) {
602-
let args = a.split('\x1f').map(str::to_string);
602+
let args = a
603+
.split('\x1f')
604+
.filter(|s| !s.is_empty())
605+
.map(str::to_string);
603606
return Ok(args.collect());
604607
}
605608

0 commit comments

Comments
 (0)