From 3c9642b54de6f711a921de76303b06ecdec36ebb Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Sat, 13 Mar 2004 12:14:37 +0000 Subject: [PATCH] fixed debug assert in VC 7.1 CRT due to calling isalnum() with 8bit chars git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@26203 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/common/fileconf.cpp | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/src/common/fileconf.cpp b/src/common/fileconf.cpp index e3af92c28a..af4fd10b06 100644 --- a/src/common/fileconf.cpp +++ b/src/common/fileconf.cpp @@ -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; } -- 2.45.2