Skip to content

Commit

Permalink
Auto merge of rust-lang#35117 - aravind-pg:path, r=alexcrichton
Browse files Browse the repository at this point in the history
On Windows, ensure PATH does not contain invalid character `"`

Fixes rust-lang#34959.

r? @alexcrichton
  • Loading branch information
bors authored Jul 30, 2016
2 parents ffcbd2d + 4ffbb5d commit 7f7969e
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 7f7969e

Please sign in to comment.