X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/17256d1ed028fadca9ba5ebe076f961353a15310..db4c39a9e87953142471077d6d26e509b2b05b6c:/src/common/fileconf.cpp?ds=sidebyside diff --git a/src/common/fileconf.cpp b/src/common/fileconf.cpp index e3af92c28a..f2118e743e 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 + ((unsigned char)c < 127) && +#endif // ANSI + !wxIsalnum(c) && !wxStrchr(wxT("@_/-!.*%"), c) ) + { strResult += wxT('\\'); + } strResult += c; }