Commit c00a93e9 authored by marco.'s avatar marco.
Browse files

MacOSX: a strange bug with setvbuf in FILE_LINE_READER disalign the netlist reader.

parent 126a7c10
Loading
Loading
Loading
Loading
+6 −1
Original line number Original line Diff line number Diff line
@@ -80,9 +80,14 @@ bool NETLIST_READER::ReadOldFmtdNetList( FILE* aFile )
    /* First, read the netlist: Build the list of footprints found in netlist
    /* First, read the netlist: Build the list of footprints found in netlist
     */
     */


#ifndef __WXMAC__
    // netlineReader dtor will close aFile
    // netlineReader dtor will close aFile
    FILE_LINE_READER netlineReader( aFile, m_netlistFullName );
    FILE_LINE_READER netlineReader( aFile, m_netlistFullName );

#else
    //Seems that the setvbuf call destroys the FILE buffer (already allocated)
    //And looses the first 4096 bytes so we set doOwn => false
    FILE_LINE_READER netlineReader( aFile, m_netlistFullName, false );
#endif
    COMPONENT_INFO *curComponent = NULL;
    COMPONENT_INFO *curComponent = NULL;
    while( netlineReader.ReadLine() )
    while( netlineReader.ReadLine() )
    {
    {