Remove dependency to CPP: support for #include directive

The parser is prepared to handle '#' directives, starting with file
inclusion. The search path for the file are taken from what was
actually given to CPP. There is an arbitrary limit to the inclusion
nesting, which is actually not a design limitation but a security
to avoid infinite include loops.
This commit is contained in:
Christophe CURIS authored and Carlos R. Mafra committed 2012-07-14 20:22:20 +02:00
1 parent ed9482b626
commit 88a82ab8df
4 files changed
+183 -8

No files matched your search

+2 -2
View File
@@ -969,7 +969,7 @@ static WMenu *readMenuFile(WScreen * scr, char *file_name)
return NULL;
}
}
parser = WMenuParserCreate(file_name, file);
parser = WMenuParserCreate(file_name, file, DEF_CONFIG_PATHS);
while (WMenuParserGetLine(parser, &title, &command, &params, &shortcut)) {
@@ -1060,7 +1060,7 @@ static WMenu *readMenuPipe(WScreen * scr, char **file_name)
return NULL;
}
}
parser = WMenuParserCreate(flat_file, file);
parser = WMenuParserCreate(flat_file, file, DEF_CONFIG_PATHS);
while (WMenuParserGetLine(parser, &title, &command, &params, &shortcut)) {