summaryrefslogtreecommitdiff
path: root/win32
diff options
context:
space:
mode:
authorGurusamy Sarathy <gsar@cpan.org>2000-08-17 00:28:19 +0000
committerGurusamy Sarathy <gsar@cpan.org>2000-08-17 00:28:19 +0000
commitec00bdd859a5ba69406f936bdf567b5b883c98d8 (patch)
treef8f7a1a18b2497058af21bdb85d718102c4f1314 /win32
parent922b18888a177879df1569d1969abfcaa0090a6f (diff)
downloadperl-ec00bdd859a5ba69406f936bdf567b5b883c98d8.tar.gz
trailing new %ENV entries weren't being pushed into the real
environment of subprocesses on Windows p4raw-id: //depot/perl@6662
Diffstat (limited to 'win32')
-rw-r--r--win32/perlhost.h12
1 files changed, 11 insertions, 1 deletions
diff --git a/win32/perlhost.h b/win32/perlhost.h
index 4509a2cad4..3d1ddd6b47 100644
--- a/win32/perlhost.h
+++ b/win32/perlhost.h
@@ -2218,7 +2218,7 @@ CPerlHost::CreateLocalEnvironmentStrings(VDir &vDir)
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);
@@ -2250,6 +2250,16 @@ CPerlHost::CreateLocalEnvironmentStrings(VDir &vDir)
}
}
+ 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';
}