Skip to content

Commit

Permalink
Auto merge of #2780 - Boddlnagg:patch-1, r=alexcrichton
Browse files Browse the repository at this point in the history
Fix `cargo doc --open` on Windows

This fixes #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
bors authored Jun 10, 2016
2 parents b5479d9 + b9a4ef1 commit 22f9cff
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 22f9cff

Please sign in to comment.