From 2bb458dd51b69fbe1b7eaa99463d29e8ada34148 Mon Sep 17 00:00:00 2001 From: Raimon Zamora Date: Thu, 7 Aug 2025 17:21:42 +0200 Subject: [PATCH] - [FIX] Quan buscaba includes no estaba ignorant els que trobava dins de comentaris --- main.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/main.cpp b/main.cpp index b1f67b1..fb65a42 100644 --- a/main.cpp +++ b/main.cpp @@ -123,6 +123,15 @@ std::vector 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"))