Skip to content

Commit

Permalink
rustbuild: Ensure PATH does not contain invalid character "
Browse files Browse the repository at this point in the history
  • Loading branch information
aravind-pg committed Jul 28, 2016
1 parent fd1d360 commit 4ffbb5d
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/bootstrap/sanity.rs
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,15 @@ use Build;
pub fn check(build: &mut Build) {
let mut checked = HashSet::new();
let path = env::var_os("PATH").unwrap_or(OsString::new());
// On Windows, quotes are invalid characters for filename paths, and if
// one is present as part of the PATH then that can lead to the system
// being unable to identify the files properly. See
// https://github.com/rust-lang/rust/issues/34959 for more details.
if cfg!(windows) {
if path.to_string_lossy().contains("\"") {
panic!("PATH contains invalid character '\"'");
}
}
let mut need_cmd = |cmd: &OsStr| {
if !checked.insert(cmd.to_owned()) {
return
Expand Down

0 comments on commit 4ffbb5d

Please sign in to comment.