X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/752f10a8a4af390471dfcc342354efe5dbdea6c4..abefd7eebac853dfc6a9b8939fa6fb8bc5dafcf6:/src/common/filename.cpp diff --git a/src/common/filename.cpp b/src/common/filename.cpp index bc37751bbf..486f75b109 100644 --- a/src/common/filename.cpp +++ b/src/common/filename.cpp @@ -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 // ----------------------------------------------------------------------------