1
0
mirror of https://github.com/gryf/wmaker.git synced 2025-12-19 20:38:08 +01:00

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
2012-06-18 00:49:53 +02:00
committed by Carlos R. Mafra
parent ed9482b626
commit 88a82ab8df
4 changed files with 183 additions and 8 deletions

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)) {