Join GitHub today
GitHub is home to over 20 million developers working together to host and review code, manage projects, and build software together.
Make preservation of envvars case insensitive on windows #52
Conversation
natefinch
reviewed
Feb 24, 2015
| - envList = windowsVariables | ||
| + // Lowercase variable names for comparison as they are case | ||
| + // insenstive on windows. Fancy folding not required for ascii. | ||
| + lowerEnv := make(map[string]string) |
natefinch
Feb 24, 2015
Contributor
this should probably be map[string]struct{} ... I'm sure the size isn't a big deal, but since we never use the value, it would be nice to make it a little more clear that the value doesn't matter.
Also, if you know the size ahead of time, you can give make a size hint:
lowerEnv := make(map[string]struct{}, len(windowsVariables) + len(testingVariables))
|
LGTM with the suggestion above. |
pushed a commit
that referenced
this pull request
Feb 24, 2015
bz2
merged commit c230cba
into
juju:master
Feb 24, 2015
bz2
deleted the
bz2:windows_env_insenstive
branch
Feb 24, 2015
bz2
referenced this pull request
in juju/juju
Feb 24, 2015
Merged
Update juju/testing dependency for windows envvar case fix #1671
added a commit
to juju/juju
that referenced
this pull request
Feb 26, 2015
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
bz2 commentedFeb 24, 2015
Treat envvars as case insenstive when whitelisting in OsEnvSuite
Because windows envvars are case insensitive but case preserving, it's possible to have a valid common value, like PATH, which would be accepted by the OS, get scrubbed. This branch changes the whitelisting to use lower cased comparisons on windows.