psrcgen: avoid include duplicates

This commit is contained in:
Alibek Omarov 2022-04-18 21:12:48 +03:00
parent 06f999f6ea
commit 4cc918001d

View File

@ -125,6 +125,13 @@ static void include_detector_init( void )
static void include_detector_push(const char *filename)
{
include_t *include;
if( !list_empty( &g_Includes ))
{
include = container_of( g_Includes.prev, include_t, node );
if( !strcmp( include->filename, filename ))
return;
}
include = malloc( sizeof( include_t ));
include->filename = strdup( filename );