Skip to content

Commit

Permalink
config: adjust config parser messages
Browse files Browse the repository at this point in the history
Some cleanup. Also, try not to call mp_msg multiple times for 1 line.
  • Loading branch information
wm4 committed Jul 13, 2014
1 parent 9b654fd commit d54d21c
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions options/parse_configfile.c
Original file line number Diff line number Diff line change
Expand Up @@ -63,24 +63,23 @@ int m_config_parse_config_file(m_config_t *config, const char *conffile,

flags = flags | M_SETOPT_FROM_CONFIG_FILE;

MP_VERBOSE(config, "Reading config file %s", conffile);
MP_VERBOSE(config, "Reading config file %s\n", conffile);

if (config->recursion_depth > MAX_RECURSION_DEPTH) {
MP_ERR(config, ": too deep 'include'. check your configfiles\n");
MP_ERR(config, "Maximum 'include' nesting depth exceeded.\n");
ret = -1;
goto out;
}

if ((line = malloc(MAX_LINE_LEN + 1)) == NULL) {
MP_FATAL(config, "\ncan't get memory for 'line': %s", strerror(errno));
ret = -1;
goto out;
} else

MP_VERBOSE(config, "\n");

if ((fp = fopen(conffile, "r")) == NULL) {
MP_VERBOSE(config, ": %s\n", strerror(errno));
MP_VERBOSE(config, "Can't open config file: %s\n", strerror(errno));
ret = 0;
goto out;
}
Expand Down Expand Up @@ -114,7 +113,7 @@ int m_config_parse_config_file(m_config_t *config, const char *conffile,
opt[opt_pos++] = line[line_pos++];
if (opt_pos >= MAX_OPT_LEN) {
PRINT_LINENUM;
MP_ERR(config, "too long option\n");
MP_ERR(config, "option name too long\n");
errors++;
ret = -1;
goto nextline;
Expand Down

0 comments on commit d54d21c

Please sign in to comment.