Commit 028b0bd3 authored by Wayne Stambaugh's avatar Wayne Stambaugh

Fix board parsing error when module name is empty. (fixes lp:1226546)

parent 0224bc2f
...@@ -1540,17 +1540,19 @@ MODULE* PCB_PARSER::parseMODULE( wxArrayString* aInitialComments ) throw( IO_ERR ...@@ -1540,17 +1540,19 @@ MODULE* PCB_PARSER::parseMODULE( wxArrayString* aInitialComments ) throw( IO_ERR
wxCHECK_MSG( CurTok() == T_module, NULL, wxCHECK_MSG( CurTok() == T_module, NULL,
wxT( "Cannot parse " ) + GetTokenString( CurTok() ) + wxT( " as MODULE." ) ); wxT( "Cannot parse " ) + GetTokenString( CurTok() ) + wxT( " as MODULE." ) );
wxPoint pt; wxString name;
T token; wxPoint pt;
FPID fpid; T token;
FPID fpid;
auto_ptr< MODULE > module( new MODULE( m_board ) ); auto_ptr< MODULE > module( new MODULE( m_board ) );
module->SetInitialComments( aInitialComments ); module->SetInitialComments( aInitialComments );
NeedSYMBOLorNUMBER(); NeedSYMBOLorNUMBER();
name = FromUTF8();
if( fpid.Parse( FromUTF8() ) >= 0 ) if( !name.IsEmpty() && fpid.Parse( FromUTF8() ) >= 0 )
{ {
wxString error; wxString error;
error.Printf( _( "invalid PFID in\nfile: <%s>\nline: %d\noffset: %d" ), error.Printf( _( "invalid PFID in\nfile: <%s>\nline: %d\noffset: %d" ),
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment