summaryrefslogtreecommitdiff
path: root/win32/perlhost.h
diff options
context:
space:
mode:
Diffstat (limited to 'win32/perlhost.h')
-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';
}