]> git.saurik.com Git - wxWidgets.git/commitdiff
fixed debug assert in VC 7.1 CRT due to calling isalnum() with 8bit chars
authorVadim Zeitlin <vadim@wxwidgets.org>
Sat, 13 Mar 2004 12:14:37 +0000 (12:14 +0000)
committerVadim Zeitlin <vadim@wxwidgets.org>
Sat, 13 Mar 2004 12:14:37 +0000 (12:14 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@26203 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

src/common/fileconf.cpp

index e3af92c28a85860bdb6314d967e84f036c30b15e..af4fd10b06eeaebdcdaa772196dda609d5361444 100644 (file)
@@ -2021,14 +2021,22 @@ static wxString FilterOutEntryName(const wxString& str)
   strResult.Alloc(str.Len());
 
   for ( const wxChar *pc = str.c_str(); *pc != wxT('\0'); pc++ ) {
-    wxChar c = *pc;
+    const wxChar c = *pc;
 
     // we explicitly allow some of "safe" chars and 8bit ASCII characters
-    // which will probably never have special meaning
+    // which will probably never have special meaning and with which we can't
+    // use isalnum() anyhow (in ASCII built, in Unicode it's just fine)
+    //
     // NB: note that wxCONFIG_IMMUTABLE_PREFIX and wxCONFIG_PATH_SEPARATOR
     //     should *not* be quoted
-    if ( !wxIsalnum(c) && !wxStrchr(wxT("@_/-!.*%"), c) && ((c & 0x80) == 0) )
+    if ( 
+#if !wxUSE_UNICODE
+            (c < 127) &&
+#endif // ANSI
+         !wxIsalnum(c) && !wxStrchr(wxT("@_/-!.*%"), c) )
+    {
       strResult += wxT('\\');
+    }
 
     strResult += c;
   }