Quote all bus members when writing to file.

Fixes https://gitlab.com/kicad/code/kicad/issues/12447
This commit is contained in:
Jeff Young 2022-10-02 17:37:02 +01:00
parent eea8c7a8fd
commit 27296b5043
1 changed files with 11 additions and 1 deletions

View File

@ -1201,9 +1201,19 @@ void SCH_SEXPR_PLUGIN::saveBusAlias( std::shared_ptr<BUS_ALIAS> aAlias, int aNes
{ {
wxCHECK_RET( aAlias != nullptr, "BUS_ALIAS* is NULL" ); wxCHECK_RET( aAlias != nullptr, "BUS_ALIAS* is NULL" );
wxString members;
for( const wxString& member : aAlias->Members() )
{
if( !members.IsEmpty() )
members += wxS( " " );
members += m_out->Quotew( member );
}
m_out->Print( aNestLevel, "(bus_alias %s (members %s))\n", m_out->Print( aNestLevel, "(bus_alias %s (members %s))\n",
m_out->Quotew( aAlias->GetName() ).c_str(), m_out->Quotew( aAlias->GetName() ).c_str(),
TO_UTF8( boost::algorithm::join( aAlias->Members(), " " ) ) ); TO_UTF8( members ) );
} }