X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/f72124dbe5f289165f7c05ba6c3dcbef89e0ead6..594f0f5bf1355fb8d58f403d3ebacc1c1767c429:/src/common/filename.cpp diff --git a/src/common/filename.cpp b/src/common/filename.cpp index 3785a8682e..d30a7f8ba1 100644 --- a/src/common/filename.cpp +++ b/src/common/filename.cpp @@ -70,18 +70,18 @@ void wxFileName::Assign( const wxString& path, { wxStringTokenizer tn(path, GetPathSeparators(format), wxTOKEN_RET_EMPTY_ALL); - bool first = TRUE; + int i = 0; m_dirs.Clear(); 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()) + // If the path starts with a slash (or two for a network path), + // we need the first dir entry to be an empty for later reassembly. + if ((i < 2) || !token.IsEmpty()) m_dirs.Add( token ); - first = FALSE; + i ++; } m_ext = ext; @@ -666,7 +666,7 @@ wxString wxFileName::GetLongPath() const pathOut = wxEmptyString; wxArrayString dirs = GetDirs(); - dirs.Add(GetName()); + dirs.Add(GetFullName()); size_t count = dirs.GetCount(); size_t i;