From b5bb56426ab87a4f31233f3a68c29d7f577285d6 Mon Sep 17 00:00:00 2001 From: Wayne Stambaugh Date: Thu, 9 May 2013 21:51:55 -0400 Subject: [PATCH] Fix footprint library search path bug. (fixes lp:1178427 --- common/footprint_info.cpp | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/common/footprint_info.cpp b/common/footprint_info.cpp index e94c522c18..5c37788a31 100644 --- a/common/footprint_info.cpp +++ b/common/footprint_info.cpp @@ -32,20 +32,14 @@ * and their documentation (comments and keywords) */ #include -#include #include -#include #include #include - -#include -#include +#include #include #include -#include #include -#include bool FOOTPRINT_LIST::ReadFootprintFiles( wxArrayString& aFootprintsLibNames ) @@ -62,14 +56,20 @@ bool FOOTPRINT_LIST::ReadFootprintFiles( wxArrayString& aFootprintsLibNames ) // Parse Libraries Listed for( unsigned ii = 0; ii < aFootprintsLibNames.GetCount(); ii++ ) { - // File names can be fully qualified or file name only. + // Footprint library file names can be fully qualified or file name only. wxFileName filename = aFootprintsLibNames[ii]; - if( !filename.IsAbsolute() ) + if( !filename.FileExists() ) { - filename = wxFileName( wxEmptyString, aFootprintsLibNames[ii], - LegacyFootprintLibPathExtension ); - filename = wxGetApp().FindLibraryPath( filename ); + filename = wxGetApp().FindLibraryPath( filename.GetFullName() ); + + if( !filename.FileExists() ) + { + filename = wxFileName( wxEmptyString, aFootprintsLibNames[ii], + LegacyFootprintLibPathExtension ); + + filename = wxGetApp().FindLibraryPath( filename.GetFullName() ); + } } if( !filename.FileExists() )