diff --git a/eeschema/sch_plugins/eagle/sch_eagle_plugin.cpp b/eeschema/sch_plugins/eagle/sch_eagle_plugin.cpp index 89966be3c8..d3e13dfc8f 100644 --- a/eeschema/sch_plugins/eagle/sch_eagle_plugin.cpp +++ b/eeschema/sch_plugins/eagle/sch_eagle_plugin.cpp @@ -31,6 +31,7 @@ #include #include #include +#include #include #include #include @@ -434,12 +435,20 @@ SCH_SHEET* SCH_EAGLE_PLUGIN::Load( const wxString& aFileName, SCHEMATIC* aSchema wxXmlDocument xmlDocument; wxFFileInputStream stream( m_filename.GetFullPath() ); - // read first line to check for legacy kicad sch file - wxTextInputStream text( stream ); - wxString line = text.ReadLine(); - if( line.StartsWith( wxT( "EESchema" ) ) ) + // check if this is an eagle XML file as we currently only support XML files, not binary files + wxString str; + + // open the file + wxTextFile tfile; + tfile.Open(aFileName); + + // read the first line + str = tfile.GetFirstLine(); + + if(!str.StartsWith(wxT("