]> git.saurik.com Git - wxWidgets.git/blobdiff - src/msw/dir.cpp
optimized wxStringTokenizer: it's now slightly faster in wchar_t build and much faste...
[wxWidgets.git] / src / msw / dir.cpp
index 42b0128b412bccbd2e2ec2c337ed8da64e01853e..ae9d7ddb9b573b2fc7989c9ec16b6b02c343da0c 100644 (file)
@@ -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);
 
@@ -198,7 +201,7 @@ bool wxDirData::Read(wxString *filename)
 
         if ( err != ERROR_FILE_NOT_FOUND && err != ERROR_NO_MORE_FILES )
         {
-            wxLogSysError(err, _("Can not enumerate files in directory '%s'"),
+            wxLogSysError(err, wxString(_("Can not enumerate files in directory '%s'")),
                           m_dirname.c_str());
         }
 #endif // __WIN32__