wxGetUserHome() may return const val.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@2195 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Ove Kaaven 1999-04-16 11:30:09 +00:00
parent 2aaf2049c0
commit 0e6667e269

View File

@ -514,7 +514,7 @@ wxChar *wxExpandPath(wxChar *buf, const wxChar *name)
/* prefix ~ */ /* prefix ~ */
if (nm[1] == SEP || nm[1] == 0) if (nm[1] == SEP || nm[1] == 0)
{ /* ~/filename */ { /* ~/filename */
if ((s = wxGetUserHome(_T(""))) != NULL) { if ((s = WXSTRINGCAST wxGetUserHome(_T(""))) != NULL) {
if (*++nm) if (*++nm)
nm++; nm++;
} }
@ -527,7 +527,7 @@ wxChar *wxExpandPath(wxChar *buf, const wxChar *name)
was_sep = (*s == SEP); was_sep = (*s == SEP);
nnm = *s ? s + 1 : s; nnm = *s ? s + 1 : s;
*s = 0; *s = 0;
if ((home = wxGetUserHome(wxString(nm + 1))) == NULL) { if ((home = WXSTRINGCAST wxGetUserHome(wxString(nm + 1))) == NULL) {
if (was_sep) /* replace only if it was there: */ if (was_sep) /* replace only if it was there: */
*s = SEP; *s = SEP;
s = _T(""); s = _T("");
@ -577,7 +577,7 @@ wxContractPath (const wxString& filename, const wxString& envname, const wxStrin
#endif #endif
// Handle environment // Handle environment
wxChar *val = (wxChar *) NULL; const wxChar *val = (const wxChar *) NULL;
wxChar *tcp = (wxChar *) NULL; wxChar *tcp = (wxChar *) NULL;
if (envname != WXSTRINGCAST NULL && (val = wxGetenv (WXSTRINGCAST envname)) != NULL && if (envname != WXSTRINGCAST NULL && (val = wxGetenv (WXSTRINGCAST envname)) != NULL &&
(tcp = wxStrstr (dest, val)) != NULL) (tcp = wxStrstr (dest, val)) != NULL)