summaryrefslogtreecommitdiff
path: root/win32
diff options
context:
space:
mode:
authorGurusamy Sarathy <gsar@cpan.org>2001-12-04 14:07:01 +0000
committerGurusamy Sarathy <gsar@cpan.org>2001-12-04 14:07:01 +0000
commit85fdc8b6e74c83540771af9354dcfc6175c9f46e (patch)
tree42b8e99dc4d273cc027d8cf725e9f4a3f7daa81a /win32
parent00bb525ad4544580488b3419990a62cde6ffca1e (diff)
downloadperl-85fdc8b6e74c83540771af9354dcfc6175c9f46e.tar.gz
integrate change#13453 from maint-5.6
tweak change#11399 to use an explicit flag rather than ass_u_ming w32_pseudo_id will only be zero for the real toplevel interpreter; avoids multiple hosts from diddling the environment at the same time p4raw-link: @13453 on //depot/maint-5.6/perl: 829f00ecc11a9cddae48275231aee0af40ec2be6 p4raw-link: @11399 on //depot/maint-5.6/perl: 0f7fbaf2aaedb3ed60637203319f491dc1812a50 p4raw-id: //depot/perl@13457 p4raw-integrated: from //depot/maint-5.6/perl@13456 'merge in' win32/perlhost.h (@12200..)
Diffstat (limited to 'win32')
-rw-r--r--win32/perlhost.h10
1 files changed, 7 insertions, 3 deletions
diff --git a/win32/perlhost.h b/win32/perlhost.h
index cd433fde89..9493a73187 100644
--- a/win32/perlhost.h
+++ b/win32/perlhost.h
@@ -210,6 +210,7 @@ protected:
DWORD m_dwEnvCount;
LPSTR* m_lppEnvList;
+ BOOL m_bTopLevel; // is this a toplevel host?
static long num_hosts;
public:
inline int LastHost(void) { return num_hosts == 1L; };
@@ -1932,6 +1933,7 @@ CPerlHost::CPerlHost(void)
m_dwEnvCount = 0;
m_lppEnvList = NULL;
+ m_bTopLevel = TRUE;
CopyMemory(&m_hostperlMem, &perlMem, sizeof(perlMem));
CopyMemory(&m_hostperlMemShared, &perlMemShared, sizeof(perlMemShared));
@@ -1981,6 +1983,7 @@ CPerlHost::CPerlHost(struct IPerlMem** ppMem, struct IPerlMem** ppMemShared,
m_dwEnvCount = 0;
m_lppEnvList = NULL;
+ m_bTopLevel = FALSE;
CopyMemory(&m_hostperlMem, &perlMem, sizeof(perlMem));
CopyMemory(&m_hostperlMemShared, &perlMemShared, sizeof(perlMemShared));
@@ -2037,6 +2040,7 @@ CPerlHost::CPerlHost(CPerlHost& host)
m_dwEnvCount = 0;
m_lppEnvList = NULL;
+ m_bTopLevel = FALSE;
/* duplicate environment info */
LPSTR lpPtr;
@@ -2351,7 +2355,7 @@ CPerlHost::Clearenv(void)
ch = *++lpPtr;
*lpPtr = 0;
Add(lpStr);
- if (!w32_pseudo_id)
+ if (m_bTopLevel)
(void)win32_putenv(lpStr);
*lpPtr = ch;
}
@@ -2366,7 +2370,7 @@ char*
CPerlHost::Getenv(const char *varname)
{
dTHX;
- if (w32_pseudo_id) {
+ if (!m_bTopLevel) {
char *pEnv = Find(varname);
if (pEnv && *pEnv)
return pEnv;
@@ -2379,7 +2383,7 @@ CPerlHost::Putenv(const char *envstring)
{
dTHX;
Add(envstring);
- if (!w32_pseudo_id)
+ if (m_bTopLevel)
return win32_putenv(envstring);
return 0;