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], '=');
ch = *++lpPtr;
*lpPtr = 0;
Add(lpStr);
+ if (!w32_pseudo_id)
+ (void)win32_putenv(lpStr);
*lpPtr = ch;
}
lpStr += strlen(lpStr) + 1;
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;
}
*/
const char* defaultshell = (IsWinNT()
? "cmd.exe /x/c" : "command.com /c");
- const char *usershell = getenv("PERL5SHELL");
+ const char *usershell = PerlEnv_getenv("PERL5SHELL");
w32_perlshell_items = tokenize(usershell ? usershell : defaultshell,
&w32_perlshell_tokens,
&w32_perlshell_vec);
}
/* look in PATH */
- pathstr = win32_getenv("PATH");
+ pathstr = PerlEnv_getenv("PATH");
New(0, fullcmd, MAX_PATH+1, char);
curfullcmd = fullcmd;