Don't return wxEmptyString for e.g. wxPathOnly("\file.txt")

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@28511 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Julian Smart
2004-07-26 20:55:59 +00:00
parent 7649d8fc00
commit 5c760b84fc

View File

@@ -879,6 +879,9 @@ wxString wxPathOnly (const wxString& path)
// Unix like or Windows
if (path[i] == wxT('/') || path[i] == wxT('\\'))
{
// Don't return an empty string
if (i == 0)
i ++;
buf[i] = 0;
return wxString(buf);
}