Commit 459ea68f authored by Pietro Fezzardi's avatar Pietro Fezzardi

lib/conf.c: fix config parsing errors

the cur_ppi_n field in ppg was not reset properly at
the beginning of the parsing function, causing the
CHECK_PPI macro to fail
parent 2067f0f5
...@@ -355,6 +355,10 @@ static int pp_parse_conf(struct pp_globals *ppg, char *conf, int len) ...@@ -355,6 +355,10 @@ static int pp_parse_conf(struct pp_globals *ppg, char *conf, int len)
int lineno = 1; int lineno = 1;
line = conf; line = conf;
/* clear current ppi, don't store current ppi across different
* configuration files or strings */
ppg->cfg.cur_ppi_n = -1;
/* parse config */
do { do {
for (rest = line; for (rest = line;
*rest && *rest != '\n' && *rest != ';'; rest++) *rest && *rest != '\n' && *rest != ';'; rest++)
...@@ -367,9 +371,6 @@ static int pp_parse_conf(struct pp_globals *ppg, char *conf, int len) ...@@ -367,9 +371,6 @@ static int pp_parse_conf(struct pp_globals *ppg, char *conf, int len)
if (term == '\n') if (term == '\n')
lineno++; lineno++;
} while (term); /* if terminator was already 0, we are done */ } while (term); /* if terminator was already 0, we are done */
/* clear current ppi, don't store current ppi across different
* configuration files or strings */
ppg->cfg.cur_ppi_n = -1;
return errcount ? -1 : 0; return errcount ? -1 : 0;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment