X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/bcbe86e5922c9a1e4814a44afb8f33e9694bee6a..243d4b360385d3364e96d5600f693139e359fb3b:/src/common/filename.cpp?ds=inline diff --git a/src/common/filename.cpp b/src/common/filename.cpp index b9679a11a3..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;