size_t count = dirs.GetCount();
for ( size_t i = 0; i < count; i++ )
{
+ const wxString& dir = dirs[i];
+
// We're using pathOut to collect the long-name path, but using a
// temporary for appending the last path component which may be
// short-name
- tmpPath = pathOut + dirs[i];
-
- if ( tmpPath.empty() )
- continue;
-
- // can't see this being necessary? MF
- if ( tmpPath.Last() == GetVolumeSeparator(wxPATH_DOS) )
+ tmpPath = pathOut + dir;
+
+ // We must not process "." or ".." here as they would be (unexpectedly)
+ // replaced by the corresponding directory names so just leave them
+ // alone
+ //
+ // And we can't pass a drive and root dir to FindFirstFile (VZ: why?)
+ if ( tmpPath.empty() || dir == '.' || dir == ".." ||
+ tmpPath.Last() == GetVolumeSeparator(wxPATH_DOS) )
{
- // Can't pass a drive and root dir to FindFirstFile,
- // so continue to next dir
tmpPath += wxFILE_SEP_PATH;
pathOut = tmpPath;
continue;
return format;
}
+#ifdef wxHAS_FILESYSTEM_VOLUMES
+
+/* static */
+wxString wxFileName::GetVolumeString(char drive, int flags)
+{
+ wxASSERT_MSG( !(flags & ~wxPATH_GET_SEPARATOR), "invalid flag specified" );
+
+ wxString vol(drive);
+ vol += wxFILE_SEP_DSK;
+ if ( flags & wxPATH_GET_SEPARATOR )
+ vol += wxFILE_SEP_PATH;
+
+ return vol;
+}
+
+#endif // wxHAS_FILESYSTEM_VOLUMES
+
// ----------------------------------------------------------------------------
// path splitting function
// ----------------------------------------------------------------------------