Fix incorrect behavior of ReplaceIllegalFileNameChars( wxString& aName, int aReplaceChar ) for non ASCII8 chars.

(this function was using a comparison using chars to test wide chars)

Fixes: lp:1764055
https://bugs.launchpad.net/kicad/+bug/1764055
This commit is contained in:
jean-pierre charras
2018-04-15 10:06:53 +02:00
parent 9203e397fe
commit 3e64c9de38
2 changed files with 3 additions and 1 deletions
+2 -1
View File
@@ -515,10 +515,11 @@ bool ReplaceIllegalFileNameChars( wxString& aName, int aReplaceChar )
bool changed = false;
wxString result;
result.reserve( aName.Length() );
wxString illWChars = GetIllegalFileNameWxChars();
for( wxString::iterator it = aName.begin(); it != aName.end(); ++it )
{
if( strchr( illegalFileNameChars, *it ) )
if( illWChars.Find( *it ) != wxNOT_FOUND )
{
if( aReplaceChar )
result += aReplaceChar;