- [FIX] Quan buscaba includes no estaba ignorant els que trobava dins de comentaris
This commit is contained in:
9
main.cpp
9
main.cpp
@@ -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"))
|
||||
|
||||
Reference in New Issue
Block a user