From 033ab9ac715e37d66678377ea7a93dce26fc7a30 Mon Sep 17 00:00:00 2001 From: Jon Evans Date: Wed, 28 Jun 2023 19:37:50 -0400 Subject: [PATCH] DbLib: Remove slashes from table display names Fixes https://gitlab.com/kicad/code/kicad/-/issues/15074 (cherry picked from commit 0e617774dd9a8f45a555576664a2b5283d14cd27) --- common/database/database_lib_settings.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/common/database/database_lib_settings.cpp b/common/database/database_lib_settings.cpp index af579ef6fe..252e71170c 100644 --- a/common/database/database_lib_settings.cpp +++ b/common/database/database_lib_settings.cpp @@ -74,6 +74,11 @@ DATABASE_LIB_SETTINGS::DATABASE_LIB_SETTINGS( const std::string& aFilename ) : table.symbols_col = entry["symbols"].get(); table.footprints_col = entry["footprints"].get(); + // Sanitize library display names; currently only `/` is removed because we use it + // as a separator and allow it in symbol names. + table.name.erase( std::remove( table.name.begin(), table.name.end(), '/' ), + table.name.end() ); + if( entry.contains( "properties" ) && entry["properties"].is_object() ) { const nlohmann::json& pj = entry["properties"];