git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@9023
c3d73ce0-8a6f-49c7-b76d-
6d57e0e08775
- wxStringTokenizer tn( path, seps );
+ wxStringTokenizer tn( path, seps, wxTOKEN_RET_EMPTY_ALL );
+ bool first = TRUE;
while (tn.HasMoreTokens())
{
wxString token( tn.GetNextToken() );
while (tn.HasMoreTokens())
{
wxString token( tn.GetNextToken() );
+
+ // If the path starts with a slash, we need the first
+ // dir entry to be an empty for later reassembly.
+
+ if (first || !token.IsEmpty())
format = GetFormat( format );
m_name = name;
format = GetFormat( format );
m_name = name;
if (m_name == wxT(".")) return;
if (m_name == wxT("..")) return;
if (m_name == wxT(".")) return;
if (m_name == wxT("..")) return;
else
if (format == wxPATH_UNIX)
{
else
if (format == wxPATH_UNIX)
{
- ret = '/'; // FIXME: must be absolute
for (size_t i = 0; i < m_dirs.GetCount(); i++)
{
ret += m_dirs[i];
for (size_t i = 0; i < m_dirs.GetCount(); i++)
{
ret += m_dirs[i];
else
if (format == wxPATH_UNIX)
{
else
if (format == wxPATH_UNIX)
{
- ret = '/'; // FIXME: must be absolute
for (size_t i = 0; i < m_dirs.GetCount(); i++)
{
ret += m_dirs[i];
for (size_t i = 0; i < m_dirs.GetCount(); i++)
{
ret += m_dirs[i];