X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/4de1b652eaaf96dc29f5d066f59d694fe86d1d89..e3276230de335908f70232b2a5ede43665bd8d9d:/src/msw/dir.cpp diff --git a/src/msw/dir.cpp b/src/msw/dir.cpp index 42b0128b41..1bdeb321f7 100644 --- a/src/msw/dir.cpp +++ b/src/msw/dir.cpp @@ -62,7 +62,7 @@ static inline void FreeFindData(FIND_DATA fd) static inline FIND_DATA FindFirst(const wxString& spec, FIND_STRUCT *finddata) { - return ::FindFirstFile(spec, finddata); + return ::FindFirstFile(spec.fn_str(), finddata); } static inline bool FindNext(FIND_DATA fd, FIND_STRUCT *finddata) @@ -184,7 +184,10 @@ bool wxDirData::Read(wxString *filename) { filespec += _T('\\'); } - filespec += (!m_filespec ? _T("*.*") : m_filespec.c_str()); + if ( !m_filespec ) + filespec += _T("*.*"); + else + filespec += m_filespec; m_finddata = FindFirst(filespec, PTR_TO_FINDDATA); @@ -300,9 +303,20 @@ wxDir::wxDir(const wxString& dirname) bool wxDir::Open(const wxString& dirname) { delete M_DIR; - m_data = new wxDirData(dirname); + + // The Unix code does a similar test + if (wxDirExists(dirname)) + { + m_data = new wxDirData(dirname); - return true; + return true; + } + else + { + m_data = NULL; + + return false; + } } bool wxDir::IsOpened() const