minor fix to wxFileName::MakeRelativeTo(), removed broken and misleading IsWild() method, added IsDir() one
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@14948 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -955,6 +955,17 @@ bool wxFileName::MakeRelativeTo(const wxString& pathBase, wxPathFormat format)
|
||||
m_dirs.Insert(wxT(".."), 0u);
|
||||
}
|
||||
|
||||
if ( format == wxPATH_UNIX || format == wxPATH_DOS )
|
||||
{
|
||||
// a directory made relative with respect to itself is '.' under Unix
|
||||
// and DOS, by definition (but we don't have to insert "./" for the
|
||||
// files)
|
||||
if ( m_dirs.IsEmpty() && IsDir() )
|
||||
{
|
||||
m_dirs.Add(_T('.'));
|
||||
}
|
||||
}
|
||||
|
||||
m_relative = TRUE;
|
||||
|
||||
// we were modified
|
||||
@@ -1048,13 +1059,6 @@ bool wxFileName::IsPathSeparator(wxChar ch, wxPathFormat format)
|
||||
return GetPathSeparators(format).Find(ch) != wxNOT_FOUND;
|
||||
}
|
||||
|
||||
bool wxFileName::IsWild( wxPathFormat WXUNUSED(format) )
|
||||
{
|
||||
// FIXME: this is probably false for Mac and this is surely wrong for most
|
||||
// of Unix shells (think about "[...]")
|
||||
return m_name.find_first_of(_T("*?")) != wxString::npos;
|
||||
}
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// path components manipulation
|
||||
// ----------------------------------------------------------------------------
|
||||
|
Reference in New Issue
Block a user