cmd: Avoid shadowing a parameter.
This commit is contained in:
parent
38a87ecfea
commit
3631ee051e
|
@ -399,14 +399,14 @@ void WCMD_HandleTildaModifiers(WCHAR **start, WCHAR *forVariable, WCHAR *forValu
|
||||||
if (memchrW(firstModifier, '$', modifierLen) != NULL) {
|
if (memchrW(firstModifier, '$', modifierLen) != NULL) {
|
||||||
/* Special Case: Search envar specified in $[envvar] for outputparam
|
/* Special Case: Search envar specified in $[envvar] for outputparam
|
||||||
Note both $ and : are guaranteed otherwise check above would fail */
|
Note both $ and : are guaranteed otherwise check above would fail */
|
||||||
WCHAR *start = strchrW(firstModifier, '$') + 1;
|
WCHAR *begin = strchrW(firstModifier, '$') + 1;
|
||||||
WCHAR *end = strchrW(firstModifier, ':');
|
WCHAR *end = strchrW(firstModifier, ':');
|
||||||
WCHAR env[MAX_PATH];
|
WCHAR env[MAX_PATH];
|
||||||
WCHAR fullpath[MAX_PATH];
|
WCHAR fullpath[MAX_PATH];
|
||||||
|
|
||||||
/* Extract the env var */
|
/* Extract the env var */
|
||||||
memcpy(env, start, (end-start) * sizeof(WCHAR));
|
memcpy(env, begin, (end-begin) * sizeof(WCHAR));
|
||||||
env[(end-start)] = 0x00;
|
env[(end-begin)] = 0x00;
|
||||||
|
|
||||||
/* If env var not found, return empty string */
|
/* If env var not found, return empty string */
|
||||||
if ((GetEnvironmentVariableW(env, fullpath, MAX_PATH) == 0) ||
|
if ((GetEnvironmentVariableW(env, fullpath, MAX_PATH) == 0) ||
|
||||||
|
|
Loading…
Reference in New Issue