]> git.lizzy.rs Git - rust.git/commitdiff
Update src/bootstrap/config.rs
authorTuna <dvt.tnhn.krlbs@icloud.com>
Tue, 20 Sep 2022 03:29:34 +0000 (06:29 +0300)
committerGitHub <noreply@github.com>
Tue, 20 Sep 2022 03:29:34 +0000 (06:29 +0300)
Co-authored-by: Bruno Kolenbrander <59372212+mejrs@users.noreply.github.com>
src/bootstrap/config.rs

index b8e776485e6733071112d629e3ddd1eb27f583f5..8b657788a687f577152e876452b996e3c74cefd9 100644 (file)
@@ -821,7 +821,14 @@ pub fn parse(args: &[String]) -> Config {
             .and_then(|output| if output.status.success() { Some(output) } else { None });
         if let Some(output) = output {
             let git_root = String::from_utf8(output.stdout).unwrap();
-            config.src = PathBuf::from(git_root.trim().to_owned())
+            let git_root = PathBuf::from(git_root.trim()).canonicalize().unwrap();
+            let s = git_root.to_str().unwrap();
+
+            // Bootstrap is quite bad at handling /? in front of paths
+            config.src = match s.strip_prefix("\\\\?\\") {
+                Some(p) => PathBuf::from(p),
+                None => PathBuf::from(git_root),
+            };
         } else {
             // We're building from a tarball, not git sources.
             // We don't support pre-downloaded bootstrap in this case.