Skip to content

Commit

Permalink
Fixes #568
Browse files Browse the repository at this point in the history
  • Loading branch information
FilipAndersson245 authored and sharkdp committed Oct 29, 2022
1 parent af2f0ac commit f00acf9
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
8 changes: 7 additions & 1 deletion src/benchmark/executor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,13 @@ impl<'a> Executor for ShellExecutor<'a> {
) -> Result<(TimingResult, ExitStatus)> {
let mut command_builder = self.shell.command();
command_builder
.arg(if cfg!(windows) { "/C" } else { "-c" })
.arg(
if cfg!(windows) && *self.shell == Shell::Default("cmd.exe") {
"/C"
} else {
"-c"
},
)
.arg(command.get_command_line());

let mut result = run_command_and_measure_common(
Expand Down
2 changes: 1 addition & 1 deletion src/options.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ pub const DEFAULT_SHELL: &str = "sh";
pub const DEFAULT_SHELL: &str = "cmd.exe";

/// Shell to use for executing benchmarked commands
#[derive(Debug)]
#[derive(Debug, PartialEq)]
pub enum Shell {
/// Default shell command
Default(&'static str),
Expand Down

0 comments on commit f00acf9

Please sign in to comment.