From 5c760b84fcaa054e2737cd03b94c406c1684546d Mon Sep 17 00:00:00 2001 From: Julian Smart Date: Mon, 26 Jul 2004 20:55:59 +0000 Subject: [PATCH] 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 --- src/common/filefn.cpp | 3 +++ 1 file changed, 3 insertions(+) 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); } -- 2.50.0