legacy library import: fix compatibility with some old symbol libraries (*.lib files).

This commit is contained in:
jean-pierre charras 2023-11-03 12:46:56 +01:00
parent 01c5fab84b
commit 890b09499e
1 changed files with 15 additions and 4 deletions

View File

@ -95,12 +95,23 @@ void SCH_LEGACY_PLUGIN_CACHE::Load()
m_versionMajor = parseInt( reader, line, &line );
if( *line != '.' )
SCH_PARSE_ERROR( "invalid file version formatting in header", reader, line );
if( *line == '/' )
{
// Some old libraries use a version syntax like
// EESchema-LIBRARY Version 2/10/2006-18:49:15
// use 2.3 version numer to read the file
m_versionMajor = 2;
m_versionMinor = 3;
}
else
{
if( *line != '.' )
SCH_PARSE_ERROR( "invalid file version formatting in header", reader, line );
line++;
line++;
m_versionMinor = parseInt( reader, line, &line );
m_versionMinor = parseInt( reader, line, &line );
}
if( m_versionMajor < 1 || m_versionMinor < 0 || m_versionMinor > 99 )
SCH_PARSE_ERROR( "invalid file version in header", reader, line );