mirror of
https://github.com/github/codeql.git
synced 2026-02-20 00:43:44 +01:00
Merge pull request #6 from github/windows_paths
Handle Windows path prefixes
This commit is contained in:
@@ -57,10 +57,20 @@ fn path_for(dir: &Path, path: &Path, ext: &str) -> PathBuf {
|
||||
let mut result = PathBuf::from(dir);
|
||||
for component in path.components() {
|
||||
match component {
|
||||
std::path::Component::Prefix(_) => {
|
||||
// skip for now
|
||||
// TODO: handle this properly for Windows
|
||||
}
|
||||
std::path::Component::Prefix(prefix) => match prefix.kind() {
|
||||
std::path::Prefix::Disk(letter) | std::path::Prefix::VerbatimDisk(letter) => {
|
||||
result.push(format!("{}_", letter as char))
|
||||
}
|
||||
std::path::Prefix::Verbatim(x) | std::path::Prefix::DeviceNS(x) => {
|
||||
result.push(x);
|
||||
}
|
||||
std::path::Prefix::UNC(server, share)
|
||||
| std::path::Prefix::VerbatimUNC(server, share) => {
|
||||
result.push("unc");
|
||||
result.push(server);
|
||||
result.push(share);
|
||||
}
|
||||
},
|
||||
std::path::Component::RootDir => {
|
||||
// skip
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user