Change 13457 by gsar@onru on 2001/12/04 14:07:01

        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

Affected files ...

.... //depot/perl/win32/perlhost.h#44 integrate

Differences ...

==== //depot/perl/win32/perlhost.h#44 (text) ====
Index: perl/win32/perlhost.h
--- perl/win32/perlhost.h.~1~   Tue Dec  4 07:15:05 2001
+++ perl/win32/perlhost.h       Tue Dec  4 07:15:05 2001
@@ -210,6 +210,7 @@
 
     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 @@
 
     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 @@
 
     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 @@
 
     m_dwEnvCount = 0;
     m_lppEnvList = NULL;
+    m_bTopLevel = FALSE;
 
     /* duplicate environment info */
     LPSTR lpPtr;
@@ -2351,7 +2355,7 @@
            ch = *++lpPtr;
            *lpPtr = 0;
            Add(lpStr);
-           if (!w32_pseudo_id)
+           if (m_bTopLevel)
                (void)win32_putenv(lpStr);
            *lpPtr = ch;
        }
@@ -2366,7 +2370,7 @@
 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 @@
 {
     dTHX;
     Add(envstring);
-    if (!w32_pseudo_id)
+    if (m_bTopLevel)
        return win32_putenv(envstring);
 
     return 0;
End of Patch.

Reply via email to