Skip to content

Commit

Permalink
(#343) When %COMSPEC% is empty, use CMD.EXE
Browse files Browse the repository at this point in the history
  • Loading branch information
hymkor committed Dec 13, 2018
1 parent ee6fe5d commit 7dfa7bf
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion shell/source.go
Original file line number Diff line number Diff line change
Expand Up @@ -98,8 +98,14 @@ func callBatch(
cmdline.WriteString(tmpfile)
cmdline.WriteString(`" "`)

cmdexe := os.Getenv("COMSPEC")

if cmdexe == "" {
cmdexe = "cmd.exe"
}

cmd := exec.Cmd{
Path: os.Getenv("COMSPEC"),
Path: cmdexe,
Stdin: stdin,
Stdout: stdout,
Stderr: stderr,
Expand Down

0 comments on commit 7dfa7bf

Please sign in to comment.