From 318429590e195fcb246116de4e75791e76f6491c Mon Sep 17 00:00:00 2001 From: jean-pierre charras Date: Thu, 10 Nov 2016 17:47:53 +0100 Subject: [PATCH] Eeschema: Fix an issue with new schematic plugin: it expects absolute paths for libraries, but if a library is in the current working dir, its filename was not absolute, and the lib was silently ignored. Now, filenames are always absolute. --- eeschema/class_library.cpp | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/eeschema/class_library.cpp b/eeschema/class_library.cpp index d86437288c..9360ad99a7 100644 --- a/eeschema/class_library.cpp +++ b/eeschema/class_library.cpp @@ -926,7 +926,6 @@ void PART_LIBS::LoadAllLibraries( PROJECT* aProject ) throw( IO_ERROR, boost::ba fn.Clear(); fn.SetName( lib_names[i] ); fn.SetExt( SchematicLibraryFileExtension ); - // Skip if the file name is not valid.. if( !fn.IsOk() ) continue; @@ -943,7 +942,13 @@ void PART_LIBS::LoadAllLibraries( PROJECT* aProject ) throw( IO_ERROR, boost::ba } } else - { + { // ensure the lib filename has a absolute path. + // If the lib has no absolute path, and is found in the cwd by fn.FileExists(), + // make a full absolute path, to avoid issues with load library functions which + // expects an absolute path. + if( !fn.IsAbsolute() ) + fn.Normalize(); + filename = fn.GetFullPath(); }