DbLib: Remove slashes from table display names

Fixes https://gitlab.com/kicad/code/kicad/-/issues/15074


(cherry picked from commit 0e617774dd)
This commit is contained in:
Jon Evans 2023-06-28 19:37:50 -04:00
parent 228fe71eb4
commit 033ab9ac71
1 changed files with 5 additions and 0 deletions

View File

@ -74,6 +74,11 @@ DATABASE_LIB_SETTINGS::DATABASE_LIB_SETTINGS( const std::string& aFilename ) :
table.symbols_col = entry["symbols"].get<std::string>(); table.symbols_col = entry["symbols"].get<std::string>();
table.footprints_col = entry["footprints"].get<std::string>(); table.footprints_col = entry["footprints"].get<std::string>();
// 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() ) if( entry.contains( "properties" ) && entry["properties"].is_object() )
{ {
const nlohmann::json& pj = entry["properties"]; const nlohmann::json& pj = entry["properties"];