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.

This commit is contained in:
jean-pierre charras 2016-11-10 17:47:53 +01:00
parent 8734757054
commit 318429590e
1 changed files with 7 additions and 2 deletions

View File

@ -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();
}