From: Julian Smart Date: Mon, 26 Jul 2004 20:55:59 +0000 (+0000) Subject: Don't return wxEmptyString for e.g. wxPathOnly("\file.txt") X-Git-Url: https://git.saurik.com/wxWidgets.git/commitdiff_plain/5c760b84fcaa054e2737cd03b94c406c1684546d 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 --- diff --git a/src/common/filefn.cpp b/src/common/filefn.cpp index bff8bd1bc7..99a1f807a6 100644 --- a/src/common/filefn.cpp +++ b/src/common/filefn.cpp @@ -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); }