Exit with 127 when 'become' cannot find the absolute path of the command

pull/3746/head
Junegunn Choi 1 month ago
parent c48e05c738
commit c8eb2e4378
No known key found for this signature in database
GPG Key ID: 254BC280FEF9C627

@ -59,8 +59,8 @@ func (x *Executor) QuoteEntry(entry string) string {
func (x *Executor) Become(stdin *os.File, environ []string, command string) {
SetStdin(stdin)
shellPath, err := exec.LookPath(x.shell)
if err == nil {
shellPath = x.shell
if err != nil {
Exit(127)
}
args := append([]string{shellPath}, append(x.args, command)...)
syscall.Exec(shellPath, args, environ)

Loading…
Cancel
Save