about summary refs log tree commit diff
path: root/src/bootstrap
diff options
context:
space:
mode:
authorAravind Gollakota <aravindprasant@gmail.com>2016-07-23 11:53:07 -0700
committerAravind Gollakota <aravindprasant@gmail.com>2016-07-27 21:19:51 -0700
commit4ffbb5dd63ebc584291143ccc8e9d849e9c485d1 (patch)
tree880428bbcc6741c177c12d1e33dca4c0a9ce727b /src/bootstrap
parentfd1d3603d46422bef6531a2d74401361ba1d822b (diff)
downloadrust-4ffbb5dd63ebc584291143ccc8e9d849e9c485d1.tar.gz
rust-4ffbb5dd63ebc584291143ccc8e9d849e9c485d1.zip
rustbuild: Ensure PATH does not contain invalid character `"`
Diffstat (limited to 'src/bootstrap')
-rw-r--r--src/bootstrap/sanity.rs9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/bootstrap/sanity.rs b/src/bootstrap/sanity.rs
index 7c0f09c322f..73749246758 100644
--- a/src/bootstrap/sanity.rs
+++ b/src/bootstrap/sanity.rs
@@ -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