fix for mistakenly prepending slash to the filenames without paths (bug introduced by last check in)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@24242 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -1261,9 +1261,6 @@ wxString wxFileName::GetPath( int flags, wxPathFormat format ) const
|
||||
fullpath += wxGetVolumeString(GetVolume(), format);
|
||||
}
|
||||
|
||||
const size_t dirCount = m_dirs.GetCount();
|
||||
if ( dirCount )
|
||||
{
|
||||
// the leading character
|
||||
switch ( format )
|
||||
{
|
||||
@@ -1302,12 +1299,19 @@ wxString wxFileName::GetPath( int flags, wxPathFormat format ) const
|
||||
flags &= ~wxPATH_GET_SEPARATOR;
|
||||
}
|
||||
|
||||
if ( m_dirs.empty() )
|
||||
{
|
||||
// there is nothing more
|
||||
return fullpath;
|
||||
}
|
||||
|
||||
// then concatenate all the path components using the path separator
|
||||
if ( format == wxPATH_VMS )
|
||||
{
|
||||
fullpath += wxT('[');
|
||||
}
|
||||
|
||||
const size_t dirCount = m_dirs.GetCount();
|
||||
for ( size_t i = 0; i < dirCount; i++ )
|
||||
{
|
||||
switch (format)
|
||||
@@ -1351,13 +1355,6 @@ wxString wxFileName::GetPath( int flags, wxPathFormat format ) const
|
||||
{
|
||||
fullpath += wxT(']');
|
||||
}
|
||||
}
|
||||
else // no directories
|
||||
{
|
||||
// still append path separator if requested
|
||||
if ( flags & wxPATH_GET_SEPARATOR )
|
||||
fullpath += GetPathSeparator(format);
|
||||
}
|
||||
|
||||
return fullpath;
|
||||
}
|
||||
|
Reference in New Issue
Block a user