Browse code

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 authored on 11/11/2020 07:36:45
Showing 2 changed files
... ...
@@ -1265,22 +1265,10 @@ IMPORTFILE      "import_file"
1265 1265
 <COMMENT>.|{EAT_ABLE}|{CR}				{ count(); };
1266 1266
 
1267 1267
 <INITIAL>{COM_LINE}!{SER_CFG}{CR}		{ count();
1268
-											if(ksr_cfg_print_mode == 1) {
1269
-												printf("%s", yytext);
1270
-												BEGIN(CFGPRINTMODE);
1271
-											}
1272 1268
 											sr_cfg_compat=SR_COMPAT_SER;}
1273 1269
 <INITIAL>{COM_LINE}!{KAMAILIO_CFG}{CR}	{ count();
1274
-											if(ksr_cfg_print_mode == 1) {
1275
-												printf("%s", yytext);
1276
-												BEGIN(CFGPRINTMODE);
1277
-											}
1278 1270
 											sr_cfg_compat=SR_COMPAT_KAMAILIO;}
1279 1271
 <INITIAL>{COM_LINE}!{MAXCOMPAT_CFG}{CR}	{ count();
1280
-											if(ksr_cfg_print_mode == 1) {
1281
-												printf("%s", yytext);
1282
-												BEGIN(CFGPRINTMODE);
1283
-											}
1284 1272
 											sr_cfg_compat=SR_COMPAT_MAX;}
1285 1273
 
1286 1274
 <INITIAL,CFGPRINTMODE>{PREP_START}{DEFINE}{EAT_ABLE}+	{	count();
... ...
@@ -2326,6 +2326,7 @@ try_again:
2326 2326
 
2327 2327
 	yyin=cfg_stream;
2328 2328
 	debug_save = default_core_cfg.debug;
2329
+	ksr_cfg_print_initial_state();
2329 2330
 	r = yyparse();
2330 2331
 	if (ksr_cfg_print_mode == 1) {
2331 2332
 		/* printed evaluated content of config file based on include and ifdef */