- [FIX] Quan buscaba includes no estaba ignorant els que trobava dins de comentaris

This commit is contained in:
2025-08-07 17:21:42 +02:00
parent 6d5b9eb453
commit 2bb458dd51

View File

@@ -123,6 +123,15 @@ std::vector<std::string> getIncludes(std::string filename)
char *p = buffer;
while (*p != 0)
{
// Ignore commented lines
if ( (*p=='/') && (*(p+1)!=0) && (*(p+1)=='/')) while( (*p != 0) && (*p != 13) ) p++;
// Ignore comment blocks
if ( (*p=='/') && (*(p+1)!=0) && (*(p+1)=='*')) {
p+=2;
while( (*p != 0) && (*p != '*') && (*(p+1)!=0) && (*(p+1)!='/') ) p++;
}
if (*p=='#')
{
if (textFound(buffer, "#include"))