projects
/
wxWidgets.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
compilation fix for ANSI build (added #if wxUSE_UNICODE)
[wxWidgets.git]
/
src
/
os2
/
utils.cpp
diff --git
a/src/os2/utils.cpp
b/src/os2/utils.cpp
index c32be9c6e697d12bba4b8ba711e1fbdcf7c4f450..00aafc22cbaf723fac0dab4eeb6d058ee0709af4 100644
(file)
--- a/
src/os2/utils.cpp
+++ b/
src/os2/utils.cpp
@@
-83,7
+83,8
@@
bool wxGetHostName( wxChar* zBuf, int nMaxSize )
wxChar* zSysname;
const wxChar* zDefaultHost = _T("noname");
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
{
::PrfQueryProfileString( HINI_PROFILE
,(PSZ)WX_SECTION
@@
-156,7
+157,7
@@
bool wxShell( const wxString& rCommand )
SData.PgmName = (char*)zShell;
sInputs = _T("/C ") + rCommand;
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;
SData.TermQ = 0;
SData.Environment = 0;
SData.InheritOpt = SSF_INHERTOPT_SHELL;
@@
-237,11
+238,10
@@
bool wxGetEnv(const wxString& var, wxString *value)
return true;
}
return true;
}
-bool wxSetEnv(const wxString& variable, const
wxC
har *value)
+bool wxSetEnv(const wxString& variable, const
c
har *value)
{
#if defined(HAVE_SETENV)
{
#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 )
#elif defined(HAVE_PUTENV)
wxString s = variable;
if ( value )
@@
-262,6
+262,16
@@
bool wxSetEnv(const wxString& variable, const wxChar *value)
#endif
}
#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
)
void wxMilliSleep(
unsigned long ulMilliseconds
)