From 6114a5d72cc0bb03c499572a9970b67d188cbade Mon Sep 17 00:00:00 2001 From: Jeff Young Date: Thu, 26 May 2022 23:54:23 +0100 Subject: [PATCH] Escape pin names when used as netnames. Fixes https://gitlab.com/kicad/code/kicad/issues/11687 --- eeschema/sch_pin.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/eeschema/sch_pin.cpp b/eeschema/sch_pin.cpp index 4ee0d3b9f7..93b73e1761 100644 --- a/eeschema/sch_pin.cpp +++ b/eeschema/sch_pin.cpp @@ -26,7 +26,7 @@ #include #include #include - +#include "string_utils.h" SCH_PIN::SCH_PIN( LIB_PIN* aLibPin, SCH_SYMBOL* aParentSymbol ) : SCH_ITEM( aParentSymbol, SCH_PIN_T ) @@ -286,13 +286,13 @@ wxString SCH_PIN::GetDefaultNetName( const SCH_SHEET_PATH& aPath, bool aForceNoC // Pin names might not be unique between different units so we must have the // unit token in the reference designator name << GetParentSymbol()->GetRef( &aPath, true ); - name << "-" << m_libPin->GetShownName() << ")"; + name << "-" << EscapeString( m_libPin->GetShownName(), CTX_NETNAME ) << ")"; } else { - // Pin number are unique, so we skip the unit token + // Pin numbers are unique, so we skip the unit token name << GetParentSymbol()->GetRef( &aPath, false ); - name << "-Pad" << m_libPin->GetShownNumber() << ")"; + name << "-Pad" << EscapeString( m_libPin->GetShownNumber(), CTX_NETNAME ) << ")"; } if( annotated )