From 4e8072b8c27ac8c8e3d4298c24283f154fe17f91 Mon Sep 17 00:00:00 2001 From: Jeff Young Date: Sun, 15 Nov 2020 15:11:41 +0000 Subject: [PATCH] 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 --- eeschema/sch_plugins/kicad/sch_sexpr_plugin.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/eeschema/sch_plugins/kicad/sch_sexpr_plugin.cpp b/eeschema/sch_plugins/kicad/sch_sexpr_plugin.cpp index 7c837e9e65..2eb8f6983b 100644 --- a/eeschema/sch_plugins/kicad/sch_sexpr_plugin.cpp +++ b/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 newSheet = std::make_unique( 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() );