Skip to content

Commit

Permalink
Fix cargo doc --open on Windows
Browse files Browse the repository at this point in the history
This fixes rust-lang#2446. Note that I have not built cargo with this change, but I have tested the functionality in isolation (on Windows 10).

As to the issue itself, I don't know why the previous version didn't work, but `start` is redundant when `cmd /C` is used.
  • Loading branch information
Boddlnagg authored Jun 10, 2016
1 parent b5479d9 commit b9a4ef1
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/cargo/ops/cargo_doc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -99,9 +99,9 @@ fn open_docs(path: &Path) -> Result<&'static str, Vec<&'static str>> {

#[cfg(target_os = "windows")]
fn open_docs(path: &Path) -> Result<&'static str, Vec<&'static str>> {
match Command::new("cmd").arg("/C").arg("start").arg("").arg(path).status() {
Ok(_) => return Ok("cmd /C start"),
Err(_) => return Err(vec!["cmd /C start"])
match Command::new("cmd").arg("/C").arg(path).status() {
Ok(_) => return Ok("cmd /C"),
Err(_) => return Err(vec!["cmd /C"])
};
}

Expand Down

0 comments on commit b9a4ef1

Please sign in to comment.