Browse Source

Prefer relative paths.

This also prevents us from leaking private information into netlists
and PCBNew files.

Fixes https://gitlab.com/kicad/code/kicad/issues/6361
6.0.7
Jeff Young 5 years ago
parent
commit
4e8072b8c2
  1. 6
      eeschema/sch_plugins/kicad/sch_sexpr_plugin.cpp

6
eeschema/sch_plugins/kicad/sch_sexpr_plugin.cpp

@ -432,7 +432,11 @@ SCH_SHEET* SCH_SEXPR_PLUGIN::Load( const wxString& aFileName, SCHEMATIC* aSchema
{
// Clean up any allocated memory if an exception occurs loading the schematic.
std::unique_ptr<SCH_SHEET> newSheet = std::make_unique<SCH_SHEET>( aSchematic );
newSheet->SetFileName( aFileName );
wxFileName relPath( aFileName );
relPath.MakeRelativeTo( aSchematic->Prj().GetProjectPath(), wxPATH_UNIX );
newSheet->SetFileName( relPath.GetFullPath() );
m_rootSheet = newSheet.get();
loadHierarchy( newSheet.get() );

Loading…
Cancel
Save