Fix for invalid environment variable names used on windows that start with an equals symbol. Even though this contradicts the Microsoft docs.

This commit is contained in:
Simon Lightfoot
2016-08-15 20:28:17 +01:00
parent 454b1e3939
commit f372f5fce7
2 changed files with 15 additions and 1 deletions

View File

@@ -64,7 +64,7 @@ func (c Context) Env() map[string]string {
envVars := make(map[string]string, len(osEnv))
for _, env := range osEnv {
data := strings.SplitN(env, "=", 2)
if len(data) == 2 {
if len(data) == 2 && len(data[0]) > 0 {
envVars[data[0]] = data[1]
}
}