diff options
| author | Joseph Rafael Ferrer <rafael2x0@gmail.com> | 2020-11-23 21:51:55 +0800 |
|---|---|---|
| committer | Joseph Rafael Ferrer <rafael2x0@gmail.com> | 2020-11-23 22:37:51 +0800 |
| commit | 6b47920c69fa048331aeb46612b158ded7c6e12e (patch) | |
| tree | fb18902adf4afbca5f23163ce2179fd8b3a53f3a /src/bootstrap | |
| parent | 32da90b431919eedb3e281a91caea063ba4edb77 (diff) | |
| download | rust-6b47920c69fa048331aeb46612b158ded7c6e12e.tar.gz rust-6b47920c69fa048331aeb46612b158ded7c6e12e.zip | |
Convert UNC path to local path to satisfy install script on Windows
Diffstat (limited to 'src/bootstrap')
| -rw-r--r-- | src/bootstrap/dist.rs | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/bootstrap/dist.rs b/src/bootstrap/dist.rs index 9b77e38a847..354be109cf2 100644 --- a/src/bootstrap/dist.rs +++ b/src/bootstrap/dist.rs @@ -1183,7 +1183,11 @@ impl Step for PlainSourceTarball { // characters and on `C:\` paths, so normalize both of them away. pub fn sanitize_sh(path: &Path) -> String { let path = path.to_str().unwrap().replace("\\", "/"); - return change_drive(&path).unwrap_or(path); + return change_drive(unc_to_lfs(&path)).unwrap_or(path); + + fn unc_to_lfs(s: &str) -> &str { + if s.starts_with("//?/") { &s[4..] } else { s } + } fn change_drive(s: &str) -> Option<String> { let mut ch = s.chars(); |
