X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/a8ff046ba980a89f11125477e736cf235ebd7186..9967de02678d23a149183bc5908c7fadcd4f76eb:/src/msw/dir.cpp diff --git a/src/msw/dir.cpp b/src/msw/dir.cpp index ae9d7ddb9b..1bdeb321f7 100644 --- a/src/msw/dir.cpp +++ b/src/msw/dir.cpp @@ -201,7 +201,7 @@ bool wxDirData::Read(wxString *filename) if ( err != ERROR_FILE_NOT_FOUND && err != ERROR_NO_MORE_FILES ) { - wxLogSysError(err, wxString(_("Can not enumerate files in directory '%s'")), + wxLogSysError(err, _("Can not enumerate files in directory '%s'"), m_dirname.c_str()); } #endif // __WIN32__ @@ -303,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