diff --git a/src/base/io/ioReadBlifMv.c b/src/base/io/ioReadBlifMv.c index 77ae18415..51ad65bec 100644 --- a/src/base/io/ioReadBlifMv.c +++ b/src/base/io/ioReadBlifMv.c @@ -696,6 +696,35 @@ static char * Io_MvLoadFile( char * pFileName ) return pContents; } +/**Function************************************************************* + + Synopsis [] + + Description [] + + SideEffects [] + + SeeAlso [] + +***********************************************************************/ +void Io_MvReplaceBuffersByShorts( char * p ) +{ + if ( !strstr(p, ".gate") ) + return; + char * q, * pNext, * pShort = (char *)".short"; int i; + for ( q = p; *q && (pNext = strstr(q, ".names")); q = pNext ) { + for ( i = 0; i < 6; i++ ) + pNext[i] = pShort[i]; + while ( *pNext && *pNext++ != '\n' ); + if ( *pNext == 0 ) + return; + while ( *pNext && *pNext != '\n' ) + *pNext++ = ' '; + if ( *pNext == 0 ) + return; + } +} + /**Function************************************************************* Synopsis [Prepares the parsing.] @@ -717,6 +746,8 @@ static void Io_MvReadPreparse( Io_MvMan_t * p ) { char * pCur, * pPrev; int i, fComment = 0; + Io_MvReplaceBuffersByShorts( p->pBuffer ); + // parse the buffer into lines and remove comments Vec_PtrPush( p->vLines, p->pBuffer ); for ( pCur = p->pBuffer; *pCur; pCur++ )