]> git.saurik.com Git - wxWidgets.git/blobdiff - src/msw/dir.cpp
Regenerated message catalogs with the strings inside wxGetTranslation().
[wxWidgets.git] / src / msw / dir.cpp
index 55f855cf6f9ffe9ecbd48b917a64f6e2b829b98b..0867811c7025d388be912279ba5e393b6714e27b 100644 (file)
@@ -4,7 +4,6 @@
 // Author:      Vadim Zeitlin
 // Modified by:
 // Created:     08.12.99
-// RCS-ID:      $Id$
 // Copyright:   (c) 1999 Vadim Zeitlin <zeitlin@dptmaths.ens-cachan.fr>
 // Licence:     wxWindows licence
 /////////////////////////////////////////////////////////////////////////////
@@ -77,8 +76,22 @@ const wxChar *GetNameFromFindData(const FIND_STRUCT *finddata)
 inline bool
 CheckFoundMatch(const FIND_STRUCT* finddata, const wxString& filter)
 {
-    return filter.empty() ||
-                wxString(GetNameFromFindData(finddata)).Matches(filter);
+    // If there is no filter, the found file must be the one we really are
+    // looking for.
+    if ( filter.empty() )
+        return true;
+
+    // Otherwise do check the match validity. Notice that we must do it
+    // case-insensitively because the case of the file names is not supposed to
+    // matter under Windows.
+    wxString fn(GetNameFromFindData(finddata));
+
+    // However if the filter contains only special characters (which is a
+    // common case), we can skip the case conversion.
+    if ( filter.find_first_not_of(wxS("*?.")) == wxString::npos )
+        return fn.Matches(filter);
+
+    return fn.MakeUpper().Matches(filter.Upper());
 }
 
 inline bool