]> git.saurik.com Git - wxWidgets.git/blobdiff - src/common/filefn.cpp
Don't return wxEmptyString for e.g. wxPathOnly("\file.txt")
[wxWidgets.git] / src / common / filefn.cpp
index bff8bd1bc717e56667ef029cfce3367b6ee45db0..99a1f807a66edba45b15354dd0d061389cbfc07f 100644 (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);
             }