1
Fork 0

Handle unicode natvis paths, simplify extension check to a single if.

This commit is contained in:
MaulingMonkey 2017-07-20 16:09:24 -07:00
parent cfc128cea4
commit 65b7908e10

View file

@ -484,14 +484,10 @@ impl<'a> Linker for MsvcLinker<'a> {
match entry {
Ok(entry) => {
let path = entry.path();
if let Some(ext) = path.extension() {
if ext == OsStr::new("natvis") {
if let Some(natvis_path_str) = path.to_str() {
self.cmd.arg(&format!("/NATVIS:{}",natvis_path_str));
} else {
self.sess.warn(&format!("natvis path not unicode: {:?}", path));
}
}
if path.extension() == Some("natvis".as_ref()) {
let mut arg = OsString::from("/NATVIS:");
arg.push(path);
self.cmd.arg(arg);
}
},
Err(err) => {