X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/bd5c39687106d5392bd059bc63bd98df62f761d6..8193abb6dcb43af52732feb036bc96b5423ae2d9:/src/msw/utils.cpp diff --git a/src/msw/utils.cpp b/src/msw/utils.cpp index baeeb9e5b7..fb792f42b3 100644 --- a/src/msw/utils.cpp +++ b/src/msw/utils.cpp @@ -467,14 +467,14 @@ const wxChar* wxGetHomeDir(wxString *pstr) return strDir.c_str(); } -wxChar *wxGetUserHome(const wxString& WXUNUSED(user)) +wxString wxGetUserHome(const wxString& user) { - // VZ: the old code here never worked for user != "" anyhow! Moreover, it - // returned sometimes a malloc()'d pointer, sometimes a pointer to a - // static buffer and sometimes I don't even know what. - static wxString s_home; + wxString home; - return (wxChar *)wxGetHomeDir(&s_home); + if ( user.empty() || user == wxGetUserId() ) + wxGetHomeDir(&home); + + return home; } bool wxGetDiskSpace(const wxString& WXUNUSED_IN_WINCE(path),