Fix environment variables with the same prefix being skipped unintentionally (#98)

If you have two env variables (for example ONE_VARIABLE and ONE_VARIABLE_NAME) ONE_VARIABLE_NAME has prefix ONE_VARIABLE and will be skipped.

Co-authored-by: Jakob <dev@schrej.net>
This commit is contained in:
kaziu687 2021-07-05 00:07:46 +02:00 committed by GitHub
parent 1c8efa2fd0
commit c0a487c47e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -129,7 +129,7 @@ eloop:
for k := range s.Config().EnvVars {
// Don't allow any environment variables that we have already set above.
for _, e := range out {
if strings.HasPrefix(e, strings.ToUpper(k)) {
if strings.HasPrefix(e, strings.ToUpper(k) + "=") {
continue eloop
}
}