Eeschema: fix symbol library remap bug.

The original decision to escape the legacy symbol library names results
in them being escaped every time they are opened which cause the curly
braces '}' from the original escaping to be escaped on subsequent
openings.  This resulted in the symbol library names in the rescue
library not matching the library ID in the schematic.

This fix is likely to have other corner case bugs given the potential
for escaped characters in legacy symbol libraries.  Given that we now
have escaped rescue libraries in play, removing the escaping will only
result in more issues so we will have to fix the corner cases as we go.

Fixes https://gitlab.com/kicad/code/kicad/-/issues/11563
This commit is contained in:
Wayne Stambaugh 2022-06-05 17:00:32 -04:00
parent 9f38fa43cd
commit dfea73f78c
1 changed files with 7 additions and 1 deletions

View File

@ -302,7 +302,13 @@ LIB_SYMBOL* SCH_LEGACY_PLUGIN_CACHE::LoadPart( LINE_READER& aReader, int aMajorV
wxString name, prefix, tmp;
name = tokens.GetNextToken();
name = EscapeString( name, CTX_LIBID );
// Don't escape symbol library name if it's already been escaped. Given that the original
// change to escape the symbol library name has resulted in rescue libraries with escaped
// names, we will have to live with the consequences.
if( name == UnescapeString( name ) )
name = EscapeString( name, CTX_LIBID );
pos += name.size() + 1;
prefix = tokens.GetNextToken();