environment of subprocesses on Windows
p4raw-id: //depot/perl@6662
ok 29, ($Is_MSWin32 ? (`cmd /x /c set foo 2>NUL` eq "")
: (`echo \$foo` eq "\n") );
- $ENV{NoNeSuCh} = "foo";
+ $ENV{__NoNeSuCh} = "foo";
$0 = "bar";
- ok 30, ($Is_MSWin32 ? (`cmd /x /c set NoNeSuCh` eq "NoNeSuCh=foo\n")
- : (`echo \$NoNeSuCh` eq "foo\n") );
+ ok 30, ($Is_MSWin32 ? (`cmd /x /c set __NoNeSuCh` eq "__NoNeSuCh=foo\n")
+ : (`echo \$__NoNeSuCh` eq "foo\n") );
}
{
dwEnvIndex = 0;
lpLocalEnv = GetIndex(dwEnvIndex);
while(*lpEnvPtr != '\0') {
- if(lpLocalEnv == NULL) {
+ if(!lpLocalEnv) {
// all environment overrides have been added
// so copy string into place
strcpy(lpStr, lpEnvPtr);
}
}
+ while(lpLocalEnv) {
+ // still have environment overrides to add
+ // so copy the strings into place
+ strcpy(lpStr, lpLocalEnv);
+ nLength = strlen(lpLocalEnv) + 1;
+ lpStr += nLength;
+ lpEnvPtr += nLength;
+ lpLocalEnv = GetIndex(dwEnvIndex);
+ }
+
// add final NULL
*lpStr = '\0';
}