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
This commit is contained in:
@@ -2021,14 +2021,22 @@ static wxString FilterOutEntryName(const wxString& str)
|
|||||||
strResult.Alloc(str.Len());
|
strResult.Alloc(str.Len());
|
||||||
|
|
||||||
for ( const wxChar *pc = str.c_str(); *pc != wxT('\0'); pc++ ) {
|
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
|
// 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
|
// NB: note that wxCONFIG_IMMUTABLE_PREFIX and wxCONFIG_PATH_SEPARATOR
|
||||||
// should *not* be quoted
|
// 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 += wxT('\\');
|
||||||
|
}
|
||||||
|
|
||||||
strResult += c;
|
strResult += c;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user