Eeschema Eagle Import: More rigorous file header check

This commit is contained in:
Russell Oliver 2017-08-15 00:56:01 +10:00 committed by Maciej Suminski
parent 41f1f2cc48
commit fa6d777ee0
1 changed files with 3 additions and 1 deletions

View File

@ -1782,9 +1782,11 @@ bool SCH_EAGLE_PLUGIN::CheckHeader( const wxString& aFileName )
wxString firstline; wxString firstline;
// read the first line // read the first line
firstline = tempFile.GetFirstLine(); firstline = tempFile.GetFirstLine();
wxString secondline = tempFile.GetNextLine();
wxString thirdline = tempFile.GetNextLine();
tempFile.Close(); tempFile.Close();
return firstline.StartsWith( "<?xml" ); return firstline.StartsWith( "<?xml" ) && secondline.StartsWith("<!DOCTYPE eagle SYSTEM") && thirdline.StartsWith("<eagle version");
} }