From: Gurusamy Sarathy Date: Tue, 4 Dec 2001 14:07:01 +0000 (+0000) Subject: integrate change#13453 from maint-5.6 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=85fdc8b6e74c83540771af9354dcfc6175c9f46e;p=p5sagit%2Fp5-mst-13.2.git 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..) --- diff --git a/win32/perlhost.h b/win32/perlhost.h index cd433fd..9493a73 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;