Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix cargo doc --open on Windows #2780

Merged
merged 1 commit into from
Jun 10, 2016
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Boddlnagg authored Jun 10, 2016
commit b9a4ef18c8b2ebadfad63e67137370cf3347a209
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