#endif
#endif
+#ifdef __EMX__
+#define MAX_PATH _MAX_PATH
+#endif
+
// ----------------------------------------------------------------------------
// private classes
// ----------------------------------------------------------------------------
m_volume =
m_name =
m_ext = wxEmptyString;
+
+ // we don't have any absolute path for now
+ m_relative = TRUE;
}
/* static */
path += _T("XXXXXX");
// we need to copy the path to the buffer in which mkstemp() can modify it
- wxCharBuffer buf(path.fn_str());
+ wxCharBuffer buf = wxConvFile.cWX2MB( path );
// cast is safe because the string length doesn't change
- int fdTemp = mkstemp( (char *)buf.data() );
+ int fdTemp = mkstemp( (char*)(const char*) buf );
if ( fdTemp == -1 )
{
// this might be not necessary as mkstemp() on most systems should have
}
else // mkstemp() succeeded
{
- path = wxConvFile.cMB2WX(buf);
-
+ path = wxConvFile.cMB2WX( (const char*) buf );
+
// avoid leaking the fd
if ( fileTemp )
{
// same as above
path += _T("XXXXXX");
- wxCharBuffer buf(path.fn_str());
- if ( !mktemp( buf ) )
+ wxCharBuffer buf = wxConvFile.cWX2MB( path );
+ if ( !mktemp( (const char*) buf ) )
{
path.clear();
}
else
{
- path = wxConvFile.cMB2WX(buf);
+ path = wxConvFile.cMB2WX( (const char*) buf );
}
#else // !HAVE_MKTEMP (includes __DOS__)
// generate the unique file name ourselves
// get cwd only once - small time saving
wxString cwd = wxGetCwd();
- Normalize(wxPATH_NORM_ALL, cwd, format);
- fnBase.Normalize(wxPATH_NORM_ALL, cwd, format);
+ Normalize(wxPATH_NORM_ALL & ~wxPATH_NORM_CASE, cwd, format);
+ fnBase.Normalize(wxPATH_NORM_ALL & ~wxPATH_NORM_CASE, cwd, format);
bool withCase = IsCaseSensitive(format);
// get cwd only once - small time saving
wxString cwd = wxGetCwd();
- fn1.Normalize(wxPATH_NORM_ALL, cwd, format);
- fn2.Normalize(wxPATH_NORM_ALL, cwd, format);
+ fn1.Normalize(wxPATH_NORM_ALL & ~wxPATH_NORM_CASE, cwd, format);
+ fn2.Normalize(wxPATH_NORM_ALL & ~wxPATH_NORM_CASE, cwd, format);
if ( fn1.GetFullPath() == fn2.GetFullPath() )
return TRUE;
WIN32_FIND_DATA findFileData;
HANDLE hFind;
- pathOut = wxEmptyString;
+
+ if ( HasVolume() )
+ pathOut = GetVolume() +
+ GetVolumeSeparator(wxPATH_DOS) +
+ GetPathSeparator(wxPATH_DOS);
+ else
+ pathOut = wxEmptyString;
wxArrayString dirs = GetDirs();
dirs.Add(GetFullName());
if ( tmpPath.empty() )
continue;
- if ( tmpPath.Last() == wxT(':') )
+ // can't see this being necessary? MF
+ if ( tmpPath.Last() == GetVolumeSeparator(wxPATH_DOS) )
{
// Can't pass a drive and root dir to FindFirstFile,
// so continue to next dir
hFind = ::FindFirstFile(tmpPath, &findFileData);
if (hFind == INVALID_HANDLE_VALUE)
{
- // Error: return immediately with the original path
- return path;
+ // Error: most likely reason is that path doesn't exist, so
+ // append any unprocessed parts and return
+ for ( i += 1; i < count; i++ )
+ tmpPath += wxFILE_SEP_PATH + dirs[i];
+
+ return tmpPath;
}
pathOut += findFileData.cFileName;
m_type = from.m_type ;
m_creator = from.m_creator ;
}
- MacDefaultExtensionRecord( char * extension , OSType type , OSType creator )
+ MacDefaultExtensionRecord( const char * extension , OSType type , OSType creator )
{
strncpy( m_ext , extension , kMacExtensionMaxLength ) ;
m_ext[kMacExtensionMaxLength] = 0 ;
} ;
// we could load the pc exchange prefs here too
- for ( int i = 0 ; i < WXSIZEOF( defaults ) ; ++i )
+ for ( size_t i = 0 ; i < WXSIZEOF( defaults ) ; ++i )
{
gMacDefaultExtensions.Add( defaults[i] ) ;
}