fixed 2 bugs which were fixed in GetFullPath() but not GetPath() and which were broken by the last commit

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@15097 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin
2002-04-11 18:41:48 +00:00
parent 6aa3ea889a
commit 0ea621cc25

View File

@@ -1157,8 +1157,15 @@ wxString wxFileName::GetPath( int flags, wxPathFormat format ) const
else if ( format == wxPATH_UNIX )
{
if ( !m_relative )
{
// normally the absolute file names starts with a slash with one
// exception: file names like "~/foo.bar" don't have it
if ( m_dirs.IsEmpty() || m_dirs[0u] != _T('~') )
{
fullpath += wxFILE_SEP_PATH_UNIX;
}
}
}
// then concatenate all the path components using the path separator
size_t dirCount = m_dirs.GetCount();
@@ -1175,8 +1182,14 @@ wxString wxFileName::GetPath( int flags, wxPathFormat format ) const
{
case wxPATH_MAC:
if ( m_dirs[i] == wxT(".") )
break;
if (m_dirs[i] != wxT("..")) // convert back from ".." to nothing
{
// skip appending ':', this shouldn't be done in this
// case as "::" is interpreted as ".." under Unix
continue;
}
// convert back from ".." to nothing
if ( m_dirs[i] != wxT("..") )
fullpath += m_dirs[i];
break;
@@ -1191,7 +1204,8 @@ wxString wxFileName::GetPath( int flags, wxPathFormat format ) const
case wxPATH_VMS:
// TODO: What to do with ".." under VMS
if (m_dirs[i] != wxT("..")) // convert back from ".." to nothing
// convert back from ".." to nothing
if ( m_dirs[i] != wxT("..") )
fullpath += m_dirs[i];
break;
}