We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents da45d9b + 3f4319c commit d0b3b35Copy full SHA for d0b3b35
src/lib.rs
@@ -39,7 +39,14 @@ pub fn that<T:AsRef<OsStr>+Sized>(path: T) -> io::Result<ExitStatus> {
39
40
#[cfg(target_os = "windows")]
41
pub fn that<T:AsRef<OsStr>+Sized>(path: T) -> io::Result<ExitStatus> {
42
- try!(Command::new("cmd").arg("/C").arg("start").arg(path.as_ref()).spawn()).wait()
+ let mut cmd = Command::new("cmd");
43
+ cmd.arg("/C").arg("start");
44
+ if let Some(s) = path.as_ref().to_str() {
45
+ cmd.arg(s.replace("&", "^&"));
46
+ } else {
47
+ cmd.arg(path.as_ref());
48
+ }
49
+ try!(cmd.spawn()).wait()
50
}
51
52
#[cfg(target_os = "macos")]
0 commit comments