Hi Laurent, This approach maintains an array of stacks per depth. The initial three patches comes as a preparation. The last patch is aiming to fix the issue with glob and the maximum number of includes. Thanks for your detailed feedback and explanations. Pablo Neira Ayuso (4): scanner: call scanner_push_file() after scanner_push_file() scanner: add indesc_file_alloc() helper function scanner: call scanner_push_indesc() after scanner_push_file() scanner: multi-level input file stack for glob include/list.h | 30 ++++++++++++++ include/parser.h | 3 +- src/parser_bison.y | 5 ++- src/scanner.l | 120 +++++++++++++++++++++++++++++++++++++---------------- 4 files changed, 119 insertions(+), 39 deletions(-) -- 2.11.0