Kaynağa Gözat

core: set initial state for --cfg-print before invoking flex parsing

- no longer needed to have #!KAMAILIO, #!SER, ... in the first line
Daniel-Constantin Mierla 4 yıl önce
ebeveyn
işleme
bf28fa9145
2 değiştirilmiş dosya ile 1 ekleme ve 12 silme
  1. 0 12
      src/core/cfg.lex
  2. 1 0
      src/main.c

+ 0 - 12
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();

+ 1 - 0
src/main.c

@@ -2326,6 +2326,7 @@ try_again:
 
 	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 */