X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/034742fcd653ebc1d5ddd7ee08e74834dc5a84e0..0f314c30b8c4ffbd7d87146f72be7a061d506235:/src/common/filename.cpp diff --git a/src/common/filename.cpp b/src/common/filename.cpp index 4b0278f2c3..07840e5372 100644 --- a/src/common/filename.cpp +++ b/src/common/filename.cpp @@ -619,21 +619,7 @@ wxFileName::CreateTempFileName(const wxString& prefix, wxFile *fileTemp) } #endif // Win32/16 -#elif defined(__WXPM__) - // for now just create a file - // - // future enhancements can be to set some extended attributes for file - // systems OS/2 supports that have them (HPFS, FAT32) and security - // (HPFS386) - static const wxChar *szMktempSuffix = wxT("XXX"); - path << dir << _T('/') << name << szMktempSuffix; - - // Temporarily remove - MN - #ifndef __WATCOMC__ - ::DosCreateDir(wxStringBuffer(path, MAX_PATH), NULL); - #endif - -#else // !Windows, !OS/2 +#else // !Windows if ( dir.empty() ) { #if defined(__WXMAC__) && !defined(__DARWIN__) @@ -648,7 +634,7 @@ wxFileName::CreateTempFileName(const wxString& prefix, wxFile *fileTemp) if ( dir.empty() ) { // default - #ifdef __DOS__ + #if defined(__DOS__) || defined(__OS2__) dir = _T("."); #else dir = _T("/tmp"); @@ -723,7 +709,7 @@ wxFileName::CreateTempFileName(const wxString& prefix, wxFile *fileTemp) for ( size_t n = 0; n < numTries; n++ ) { // 3 hex digits is enough for numTries == 1000 < 4096 - pathTry = path + wxString::Format(_T("%.03x"), n); + pathTry = path + wxString::Format(_T("%.03x"), (unsigned int) n); if ( !wxFile::Exists(pathTry) ) { break; @@ -1284,7 +1270,7 @@ wxString wxFileName::GetPath( int flags, wxPathFormat format ) const // normally the absolute file names start with a slash // with one exception: the ones like "~/foo.bar" don't // have it - if ( m_dirs[0u] != _T('~') ) + if ( m_dirs.IsEmpty() || m_dirs[0u] != _T('~') ) { fullpath += wxFILE_SEP_PATH_UNIX; } @@ -1526,7 +1512,7 @@ wxPathFormat wxFileName::GetFormat( wxPathFormat format ) { if (format == wxPATH_NATIVE) { -#if defined(__WXMSW__) || defined(__WXPM__) || defined(__DOS__) +#if defined(__WXMSW__) || defined(__OS2__) || defined(__DOS__) format = wxPATH_DOS; #elif defined(__WXMAC__) && !defined(__DARWIN__) format = wxPATH_MAC;