diff options
author | Nick Ing-Simmons <nik@tiuk.ti.com> | 2001-07-18 06:50:33 +0000 |
---|---|---|
committer | Nick Ing-Simmons <nik@tiuk.ti.com> | 2001-07-18 06:50:33 +0000 |
commit | 2fb9ab56c575e2a910e23a92a6a02d3d7fd09fbb (patch) | |
tree | 7ab444cb3a77488ce686dbcc8c348c18cf0b0118 /win32/perlhost.h | |
parent | 7f82cce936e595de48eff1fbff5cb0f7628d19bf (diff) | |
download | perl-2fb9ab56c575e2a910e23a92a6a02d3d7fd09fbb.tar.gz |
Integrate Sarathy's Win32 $ENV{'PATH'}/system fixes (11399, 11400)
from perl5.6*
p4raw-id: //depot/perl@11405
p4raw-integrated: from //depot/maint-5.6/perl@11404 'merge in'
win32/win32.c (@8917..)
p4raw-integrated: from //depot/maint-5.6/perl@11400 'merge in'
win32/perlhost.h (@11399..)
Diffstat (limited to 'win32/perlhost.h')
-rw-r--r-- | win32/perlhost.h | 24 |
1 files changed, 14 insertions, 10 deletions
diff --git a/win32/perlhost.h b/win32/perlhost.h index 815be84b84..45ce0ddbf9 100644 --- a/win32/perlhost.h +++ b/win32/perlhost.h @@ -2315,9 +2315,10 @@ CPerlHost::Reset(void) void CPerlHost::Clearenv(void) { + dTHXo; char ch; LPSTR lpPtr, lpStr, lpEnvPtr; - if(m_lppEnvList != NULL) { + if (m_lppEnvList != NULL) { /* set every entry to an empty string */ for(DWORD index = 0; index < m_dwEnvCount; ++index) { char* ptr = strchr(m_lppEnvList[index], '='); @@ -2340,6 +2341,8 @@ CPerlHost::Clearenv(void) ch = *++lpPtr; *lpPtr = 0; Add(lpStr); + if (!w32_pseudo_id) + (void)win32_putenv(lpStr); *lpPtr = ch; } lpStr += strlen(lpStr) + 1; @@ -2352,22 +2355,23 @@ CPerlHost::Clearenv(void) char* CPerlHost::Getenv(const char *varname) { - char* pEnv = Find(varname); - if(pEnv == NULL) { - pEnv = win32_getenv(varname); - } - else { - if(!*pEnv) - pEnv = 0; + dTHXo; + if (w32_pseudo_id) { + char *pEnv = Find(varname); + if (pEnv && !*pEnv) + return pEnv; } - - return pEnv; + return win32_getenv(varname); } int CPerlHost::Putenv(const char *envstring) { + dTHXo; Add(envstring); + if (!w32_pseudo_id) + return win32_putenv(envstring); + return 0; } |