projects
/
wxWidgets.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
remove 'mobile' samples as they're not useful from a didactive POV nor they show...
[wxWidgets.git]
/
src
/
os2
/
utils.cpp
diff --git
a/src/os2/utils.cpp
b/src/os2/utils.cpp
index e3bc440f2714d8cafe12dd5a4bf423ce4f7a36c6..5a03ba30f3070e1c6d2aba8f569a2a59d4d04a37 100644
(file)
--- a/
src/os2/utils.cpp
+++ b/
src/os2/utils.cpp
@@
-93,13
+93,12
@@
bool wxGetHostName( wxChar* zBuf, int nMaxSize )
,(void*)zBuf
,(ULONG)nMaxSize - 1
);
,(void*)zBuf
,(ULONG)nMaxSize - 1
);
+ zBuf[nMaxSize] = _T('\0');
}
else
{
}
else
{
- wxStr
ncpy(zBuf, zSysname, nMaxSize - 1
);
+ wxStr
lcpy(zBuf, zSysname, nMaxSize
);
}
}
-
- zBuf[nMaxSize] = _T('\0');
#endif
return *zBuf ? true : false;
#endif
return *zBuf ? true : false;
@@
-121,7
+120,7
@@
bool wxGetUserName( wxChar* zBuf, int nMaxSize )
#ifdef USE_NET_API
wxGetUserId( zBuf, nMaxSize );
#else
#ifdef USE_NET_API
wxGetUserId( zBuf, nMaxSize );
#else
- wxStr
n
cpy(zBuf, _T("Unknown User"), nMaxSize);
+ wxStr
l
cpy(zBuf, _T("Unknown User"), nMaxSize);
#endif
return true;
}
#endif
return true;
}
@@
-241,6
+240,14
@@
bool wxGetEnv(const wxString& var, wxString *value)
static bool wxDoSetEnv(const wxString& variable, const char *value)
{
#if defined(HAVE_SETENV)
static bool wxDoSetEnv(const wxString& variable, const char *value)
{
#if defined(HAVE_SETENV)
+ if ( !value )
+ {
+#ifdef HAVE_UNSETENV
+ return unsetenv(variable.mb_str()) == 0;
+#else
+ value = _T(""); // mustn't pass NULL to setenv()
+#endif
+ }
return setenv(variable.mb_str(), value, 1 /* overwrite */) == 0;
#elif defined(HAVE_PUTENV)
wxString s = variable;
return setenv(variable.mb_str(), value, 1 /* overwrite */) == 0;
#elif defined(HAVE_PUTENV)
wxString s = variable;