It looks like processing of @@else is not fully implemented in aide 0.13.1. There are two logical cases for how @@else should be handled:
1. When handle_endif() is called with doit = 1; e.g., "@@undef FOO ... @@ifdef FOO", the conditional test has failed. In this case, we should skip input up to the @@else and continue processing. This is implemented.
2. When handle_endif() is called with doit = 0; e.g., "@define FOO bar ... @@ifdef FOO", the conditional test has passed. In this case, we should process everything up to @@else, then skip everything from @@else to @@endif. This is not implemented. What happens instead is that we process everything on both sides of the @@else (see also bug #1461215).
I'm unfamiliar enough with lex / yacc that I don't see immediately how to fix this. Point me in the right direction and I may be able to work on it, though.
A workaround for anyone maintaining aide.conf files:
So, in fact, direct replacement of @@else with @@endif and the opposite conditional test might turn out to be a useful trick for the parser itself to do.
Log in to post a comment.