1
0
mirror of https://gitlab.labs.nic.cz/labs/bird.git synced 2024-05-11 16:54:54 +00:00

Conf: Show the line:char position where the syntax error happens

This commit is contained in:
Jan Maria Matejka
2018-09-11 16:55:41 +02:00
parent 89b0af3978
commit d50b0bc437
4 changed files with 11 additions and 6 deletions

View File

@@ -213,7 +213,7 @@ read_config(void)
if (!unix_read_config(&conf, config_name))
{
if (conf->err_msg)
die("%s, line %d: %s", conf->err_file_name, conf->err_lino, conf->err_msg);
die("%s:%d:%d %s", conf->err_file_name, conf->err_lino, conf->err_chno, conf->err_msg);
else
die("Unable to open configuration file %s: %m", config_name);
}
@@ -230,7 +230,7 @@ async_config(void)
if (!unix_read_config(&conf, config_name))
{
if (conf->err_msg)
log(L_ERR "%s, line %d: %s", conf->err_file_name, conf->err_lino, conf->err_msg);
log(L_ERR "%s:%d:%d %s", conf->err_file_name, conf->err_lino, conf->err_chno, conf->err_msg);
else
log(L_ERR "Unable to open configuration file %s: %m", config_name);
config_free(conf);
@@ -251,7 +251,7 @@ cmd_read_config(char *name)
if (!unix_read_config(&conf, name))
{
if (conf->err_msg)
cli_msg(8002, "%s, line %d: %s", conf->err_file_name, conf->err_lino, conf->err_msg);
cli_msg(8002, "%s:%d:%d %s", conf->err_file_name, conf->err_lino, conf->err_chno, conf->err_msg);
else
cli_msg(8002, "%s: %m", name);
config_free(conf);