fix: *env.args.Shell not set in getShellName(cache never used)

*env.args.Shell was never set in getShellName.
This commit is contained in:
Laurent Nullens 2020-12-27 19:51:32 +01:00 committed by Jan De Dobbeleer
parent b4d23a4716
commit 8c812812ee

View file

@ -233,8 +233,9 @@ func (env *environment) getShellName() string {
if err != nil {
return unknown
}
shell := strings.Replace(name, ".exe", "", 1)
return strings.Trim(shell, " ")
// Cache the shell value to speed things up.
*env.args.Shell = strings.Trim(strings.Replace(name, ".exe", "", 1), " ")
return *env.args.Shell
}
func (env *environment) doGet(url string) ([]byte, error) {