wxChar* zSysname;
const wxChar* zDefaultHost = _T("noname");
- if ((zSysname = wxGetenv(_T("SYSTEM_NAME"))) == NULL)
+ if ((zSysname = wxGetenv(_T("SYSTEM_NAME"))) == NULL &&
+ (zSysname = wxGetenv(_T("HOSTNAME"))) == NULL)
{
::PrfQueryProfileString( HINI_PROFILE
,(PSZ)WX_SECTION
SData.PgmName = (char*)zShell;
sInputs = _T("/C ") + rCommand;
- SData.PgmInputs = (BYTE*)sInputs.c_str();
+ SData.PgmInputs = (BYTE*)sInputs.wx_str();
SData.TermQ = 0;
SData.Environment = 0;
SData.InheritOpt = SSF_INHERTOPT_SHELL;
return true;
}
-bool wxSetEnv(const wxString& variable, const wxChar *value)
+bool wxSetEnv(const wxString& variable, const char *value)
{
#if defined(HAVE_SETENV)
- return setenv(variable.mb_str(), value ? wxString(value).mb_str().data()
- : NULL, 1 /* overwrite */) == 0;
+ return setenv(variable.mb_str(), value, 1 /* overwrite */) == 0;
#elif defined(HAVE_PUTENV)
wxString s = variable;
if ( value )
#endif
}
+bool wxSetEnv(const wxString& variable, const wxString& value)
+{
+ return wxDoSetEnv(variable, value.mb_str());
+}
+
+bool wxUnsetEnv(const wxString& variable)
+{
+ return wxDoSetEnv(variable, NULL);
+}
+
void wxMilliSleep(
unsigned long ulMilliseconds
)