Escape slashes in labels and netnames.

Also re-allows spaces, as they can already come in through sheet
names.

Fixes: lp:1798621
* https://bugs.launchpad.net/kicad/+bug/1798621
This commit is contained in:
Jeff Young
2019-04-07 00:24:10 +01:00
parent 97063440bb
commit 684bb62fd8
31 changed files with 215 additions and 152 deletions
+3 -5
View File
@@ -34,7 +34,7 @@ void XNODE::Format( OUTPUTFORMATTER* out, int nestLevel )
switch( GetType() )
{
case wxXML_ELEMENT_NODE:
out->Print( nestLevel, "(%s", out->Quotew( GetName() ).c_str() );
out->Print( nestLevel, "(%s", TO_UTF8( GetName() ) );
FormatContents( out, nestLevel );
if( GetNext() )
out->Print( 0, ")\n" );
@@ -54,10 +54,8 @@ void XNODE::FormatContents( OUTPUTFORMATTER* out, int nestLevel )
for( XATTR* attr = (XATTR*) GetAttributes(); attr; attr = (XATTR*) attr->GetNext() )
{
out->Print( 0, " (%s %s)",
// attr names should never need quoting, no spaces, we designed the file.
out->Quotew( attr->GetName() ).c_str(),
out->Quotew( attr->GetValue() ).c_str()
);
TO_UTF8( attr->GetName() ),
out->Quotew( attr->GetValue() ).c_str() );
}
// we only expect to have used one of two types here: