From 63362c97f5c735cbddd72e6b8721c3d05fde6ca8 Mon Sep 17 00:00:00 2001 From: unknown Date: Sun, 25 Nov 2012 13:17:02 +0100 Subject: [PATCH] MacOSX: a strange bug with setvbuf in FILE_LINE_READER disalign the netlist reader. --- pcbnew/netlist_reader_firstformat.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/pcbnew/netlist_reader_firstformat.cpp b/pcbnew/netlist_reader_firstformat.cpp index 7b4df2ee44..916e553386 100644 --- a/pcbnew/netlist_reader_firstformat.cpp +++ b/pcbnew/netlist_reader_firstformat.cpp @@ -80,9 +80,14 @@ bool NETLIST_READER::ReadOldFmtdNetList( FILE* aFile ) /* First, read the netlist: Build the list of footprints found in netlist */ +#ifndef __WXMAC__ // netlineReader dtor will close aFile 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; while( netlineReader.ReadLine() ) {