Sanitise filename before saving footprint library
This commit is contained in:
parent
091f9c82e1
commit
01cc91850c
|
@ -2666,10 +2666,11 @@ void PCB_IO_KICAD_SEXPR::FootprintSave( const wxString& aLibraryPath, const FOOT
|
||||||
wxString footprintName = aFootprint->GetFPID().GetLibItemName();
|
wxString footprintName = aFootprint->GetFPID().GetLibItemName();
|
||||||
|
|
||||||
FP_CACHE_FOOTPRINT_MAP& footprints = m_cache->GetFootprints();
|
FP_CACHE_FOOTPRINT_MAP& footprints = m_cache->GetFootprints();
|
||||||
|
wxString fpName = aFootprint->GetFPID().GetLibItemName().wx_str();
|
||||||
|
ReplaceIllegalFileNameChars( fpName, '_' );
|
||||||
|
|
||||||
// Quietly overwrite footprint and delete footprint file from path for any by same name.
|
// Quietly overwrite footprint and delete footprint file from path for any by same name.
|
||||||
wxFileName fn( aLibraryPath, aFootprint->GetFPID().GetLibItemName(),
|
wxFileName fn( aLibraryPath, fpName, FILEEXT::KiCadFootprintFileExtension );
|
||||||
FILEEXT::KiCadFootprintFileExtension );
|
|
||||||
|
|
||||||
// Write through symlinks, don't replace them
|
// Write through symlinks, don't replace them
|
||||||
WX_FILENAME::ResolvePossibleSymlinks( fn );
|
WX_FILENAME::ResolvePossibleSymlinks( fn );
|
||||||
|
|
Loading…
Reference in New Issue