unused variable warning fix (patch 923094)

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@26825 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin 2004-04-15 23:15:07 +00:00
parent a3a363f61b
commit 844ca09641

View File

@ -751,17 +751,22 @@ wxContractPath (const wxString& filename, const wxString& envname, const wxStrin
#endif
// Handle User's home (ignore root homes!)
size_t len = 0;
if ((val = wxGetUserHome (user)) != NULL &&
(len = wxStrlen(val)) > 2 &&
wxStrncmp(dest, val, len) == 0)
{
wxStrcpy(wxFileFunctionsBuffer, wxT("~"));
if (user != wxT(""))
wxStrcat(wxFileFunctionsBuffer, (const wxChar*) user);
wxStrcat(wxFileFunctionsBuffer, dest + len);
wxStrcpy (dest, wxFileFunctionsBuffer);
}
val = wxGetUserHome (user);
if (!val)
return dest;
const size_t len = wxStrlen(val);
if (len <= 2)
return dest;
if (wxStrncmp(dest, val, len) == 0)
{
wxStrcpy(wxFileFunctionsBuffer, wxT("~"));
if (user != wxT(""))
wxStrcat(wxFileFunctionsBuffer, (const wxChar*) user);
wxStrcat(wxFileFunctionsBuffer, dest + len);
wxStrcpy (dest, wxFileFunctionsBuffer);
}
return dest;
}