X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/6bda7391c10e2341d5ef407df1330b9e39c202f8..095b80e2b5120d4c476a834b2017c355fa9afef0:/src/common/filename.cpp diff --git a/src/common/filename.cpp b/src/common/filename.cpp index 02e83a3506..a746dd77b6 100644 --- a/src/common/filename.cpp +++ b/src/common/filename.cpp @@ -163,7 +163,8 @@ public: filename, // name mode == Read ? GENERIC_READ // access mask : GENERIC_WRITE, - 0, // no sharing + FILE_SHARE_READ | // sharing mode + FILE_SHARE_WRITE, // (allow everything) NULL, // no secutity attr OPEN_EXISTING, // creation disposition 0, // no flags @@ -585,7 +586,7 @@ wxFileName::CreateTempFileName(const wxString& prefix, wxFile *fileTemp) } #elif defined(__WINDOWS__) && !defined(__WXMICROWIN__) -#ifdef __WIN32__ + if ( dir.empty() ) { if ( !::GetTempPath(MAX_PATH, wxStringBuffer(dir, MAX_PATH + 1)) ) @@ -612,12 +613,6 @@ wxFileName::CreateTempFileName(const wxString& prefix, wxFile *fileTemp) path.clear(); } -#else // Win16 - if ( !::GetTempFileName(NULL, prefix, 0, wxStringBuffer(path, 1025)) ) - { - path.clear(); - } -#endif // Win32/16 #else // !Windows if ( dir.empty() ) @@ -967,6 +962,7 @@ bool wxFileName::Normalize(int flags, { // VZ: expand env vars here too? + m_volume.MakeLower(); m_name.MakeLower(); m_ext.MakeLower(); } @@ -1147,8 +1143,8 @@ bool wxFileName::SameAs(const wxFileName& filepath, wxPathFormat format) const // get cwd only once - small time saving wxString cwd = wxGetCwd(); - fn1.Normalize(wxPATH_NORM_ALL & ~wxPATH_NORM_CASE, cwd, format); - fn2.Normalize(wxPATH_NORM_ALL & ~wxPATH_NORM_CASE, 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;