diff --git a/eeschema/sch_plugins/kicad/sch_sexpr_parser.cpp b/eeschema/sch_plugins/kicad/sch_sexpr_parser.cpp index 07e4e661ba..22060765fd 100644 --- a/eeschema/sch_plugins/kicad/sch_sexpr_parser.cpp +++ b/eeschema/sch_plugins/kicad/sch_sexpr_parser.cpp @@ -192,6 +192,11 @@ LIB_SYMBOL* SCH_SEXPR_PARSER::ParseSymbol( LIB_SYMBOL_MAP& aSymbolLibMap, int aF name = FromUTF8(); + // Some symbol LIB_IDs have the '/' character escaped which can break derived symbol links. + // The '/' character is no longer an illegal LIB_ID character so it doesn't need to be + // escaped. + name.Replace( wxS( "{slash}" ), wxT( "/" ) ); + LIB_ID id; int bad_pos = id.Parse( name ); @@ -268,6 +273,12 @@ LIB_SYMBOL* SCH_SEXPR_PARSER::ParseSymbol( LIB_SYMBOL_MAP& aSymbolLibMap, int aF } name = FromUTF8(); + + // Some symbol LIB_IDs have the '/' character escaped which can break derived + // symbol links. The '/' character is no longer an illegal LIB_ID character so + // it doesn't need to be escaped. + name.Replace( wxS( "{slash}" ), wxT( "/" ) ); + auto it = aSymbolLibMap.find( name ); if( it == aSymbolLibMap.end() ) @@ -293,6 +304,11 @@ LIB_SYMBOL* SCH_SEXPR_PARSER::ParseSymbol( LIB_SYMBOL_MAP& aSymbolLibMap, int aF name = FromUTF8(); + // Some symbol LIB_IDs have the '/' character escaped which can break derived + // symbol links. The '/' character is no longer an illegal LIB_ID character so + // it doesn't need to be escaped. + name.Replace( wxS( "{slash}" ), wxT( "/" ) ); + if( !name.StartsWith( m_symbolName ) ) { error.Printf( _( "Invalid symbol unit name prefix %s" ), name.c_str() );