A bit more safety around control characters in strings.

This commit is contained in:
Jeff Young
2019-09-07 01:08:22 +01:00
parent 83a02e18eb
commit 1ac6cbc4a6
+4
View File
@@ -57,6 +57,8 @@ wxString EscapeString( const wxString& aSource, ESCAPE_CONTEXT aContext )
{
if( c == '/' )
converted += "{slash}";
else if( c == '\n' || c == '\r' )
converted += ""; // drop
else
converted += c;
}
@@ -66,6 +68,8 @@ wxString EscapeString( const wxString& aSource, ESCAPE_CONTEXT aContext )
converted += "{brace}";
else if( c == ':' )
converted += "{colon}";
else if( c == '\n' || c == '\r' )
converted += ""; // drop
else
converted += c;
}