diff --git a/eeschema/dialogs/panel_sym_lib_table.cpp b/eeschema/dialogs/panel_sym_lib_table.cpp index d7e8650db8..f3f4554569 100644 --- a/eeschema/dialogs/panel_sym_lib_table.cpp +++ b/eeschema/dialogs/panel_sym_lib_table.cpp @@ -414,7 +414,9 @@ void PANEL_SYM_LIB_TABLE::browseLibrariesHandler( wxCommandEvent& event ) // try to use path normalized to an environmental variable or project path wxString path = NormalizePath( filePath, &envVars, m_projectBasePath ); - if( path.IsEmpty() ) + // Do not use the project path in the global library table. This will almost + // assuredly be wrong for a different project. + if( path.IsEmpty() || (m_pageNdx == 0 && path.Contains( "${KIPRJMOD}" )) ) path = fn.GetFullPath(); m_cur_grid->SetCellValue( last_row, COL_URI, path ); diff --git a/pcbnew/dialogs/panel_fp_lib_table.cpp b/pcbnew/dialogs/panel_fp_lib_table.cpp index a48ab09f38..d603cfc215 100644 --- a/pcbnew/dialogs/panel_fp_lib_table.cpp +++ b/pcbnew/dialogs/panel_fp_lib_table.cpp @@ -667,7 +667,9 @@ void PANEL_FP_LIB_TABLE::browseLibrariesHandler( wxCommandEvent& event ) // try to use path normalized to an environmental variable or project path wxString path = NormalizePath( filePath, &envVars, m_projectBasePath ); - if( path.IsEmpty() ) + // Do not use the project path in the global library table. This will almost + // assuredly be wrong for a different project. + if( path.IsEmpty() || (m_pageNdx == 0 && path.Contains( "${KIPRJMOD}" )) ) path = fn.GetFullPath(); m_cur_grid->SetCellValue( last_row, COL_URI, path );