X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/90a77e64841dfcaf37103b6411987402739baa0b..19c7ac3d3bf1ac2113505a805a79c40ce3db1f5b:/src/msdos/utilsdos.cpp diff --git a/src/msdos/utilsdos.cpp b/src/msdos/utilsdos.cpp index 6f432f4f89..d5c8a1a0fe 100644 --- a/src/msdos/utilsdos.cpp +++ b/src/msdos/utilsdos.cpp @@ -200,7 +200,7 @@ const wxChar* wxGetHomeDir(wxString *home) #endif // it needs to be a full path to be usable if ( prog.compare(1, 2, _T(":\\")) == 0 ) - wxSplitPath(prog, &strDir, NULL, NULL); + wxFileName::SplitPath(prog, &strDir, NULL, NULL); } if ( strDir.empty() ) { @@ -211,14 +211,14 @@ const wxChar* wxGetHomeDir(wxString *home) return strDir.c_str(); } -wxChar *wxGetUserHome(const wxString& user) +wxString wxGetUserHome(const wxString& user) { - static wxString home; + wxString home; if (user.empty() || user == wxGetUserId()) - return wx_const_cast(wxChar*, wxGetHomeDir(&home)); - else - return _T(""); + wxGetHomeDir(&home); + + return home; } // returns %UserName%, $USER or just "user" @@ -233,7 +233,7 @@ bool wxGetUserId(wxChar *buf, int n) if (!user) user = _T("user"); - wxStrncpy(buf, user, n); + wxStrlcpy(buf, user, n); return true; } @@ -254,7 +254,7 @@ bool wxGetHostName(wxChar *buf, int n) if (!host) host = _T("host"); - wxStrncpy(buf, host, n); + wxStrlcpy(buf, host, n); return true; } @@ -321,7 +321,7 @@ long wxExecute(const wxString& command, int flags, wxProcess *process) argv[n] = NULL; while (n-- > 0) - argv[n] = wx_const_cast(wxChar*, (const char *)args[n].c_str()); + argv[n] = const_cast((const char *)args[n].c_str()); long result = wxExecute(argv, flags, process);