Module: kamailio Branch: master Commit: bf28fa91455eb5d42bb2955a70fadb8d27f6bb41 URL: https://github.com/kamailio/kamailio/commit/bf28fa91455eb5d42bb2955a70fadb8d...
Author: Daniel-Constantin Mierla miconda@gmail.com Committer: Daniel-Constantin Mierla miconda@gmail.com Date: 2020-11-11T08:36:45+01:00
core: set initial state for --cfg-print before invoking flex parsing
- no longer needed to have #!KAMAILIO, #!SER, ... in the first line
---
Modified: src/core/cfg.lex Modified: src/main.c
---
Diff: https://github.com/kamailio/kamailio/commit/bf28fa91455eb5d42bb2955a70fadb8d... Patch: https://github.com/kamailio/kamailio/commit/bf28fa91455eb5d42bb2955a70fadb8d...
---
diff --git a/src/core/cfg.lex b/src/core/cfg.lex index 7d431fbfdb..679ffdb898 100644 --- a/src/core/cfg.lex +++ b/src/core/cfg.lex @@ -1265,22 +1265,10 @@ IMPORTFILE "import_file" <COMMENT>.|{EAT_ABLE}|{CR} { count(); };
<INITIAL>{COM_LINE}!{SER_CFG}{CR} { count(); - if(ksr_cfg_print_mode == 1) { - printf("%s", yytext); - BEGIN(CFGPRINTMODE); - } sr_cfg_compat=SR_COMPAT_SER;} <INITIAL>{COM_LINE}!{KAMAILIO_CFG}{CR} { count(); - if(ksr_cfg_print_mode == 1) { - printf("%s", yytext); - BEGIN(CFGPRINTMODE); - } sr_cfg_compat=SR_COMPAT_KAMAILIO;} <INITIAL>{COM_LINE}!{MAXCOMPAT_CFG}{CR} { count(); - if(ksr_cfg_print_mode == 1) { - printf("%s", yytext); - BEGIN(CFGPRINTMODE); - } sr_cfg_compat=SR_COMPAT_MAX;}
<INITIAL,CFGPRINTMODE>{PREP_START}{DEFINE}{EAT_ABLE}+ { count(); diff --git a/src/main.c b/src/main.c index 0917561a4a..373236c5d0 100644 --- a/src/main.c +++ b/src/main.c @@ -2326,6 +2326,7 @@ int main(int argc, char** argv)
yyin=cfg_stream; debug_save = default_core_cfg.debug; + ksr_cfg_print_initial_state(); r = yyparse(); if (ksr_cfg_print_mode == 1) { /* printed evaluated content of config file based on include and ifdef */