mirror of
https://github.com/mpv-player/mpv
synced 2025-04-09 03:02:13 +00:00
config: adjust config parser messages
Some cleanup. Also, try not to call mp_msg multiple times for 1 line.
This commit is contained in:
parent
9b654fd540
commit
d54d21cbd5
@ -63,16 +63,15 @@ int m_config_parse_config_file(m_config_t *config, const char *conffile,
|
|||||||
|
|
||||||
flags = flags | M_SETOPT_FROM_CONFIG_FILE;
|
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) {
|
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;
|
ret = -1;
|
||||||
goto out;
|
goto out;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((line = malloc(MAX_LINE_LEN + 1)) == NULL) {
|
if ((line = malloc(MAX_LINE_LEN + 1)) == NULL) {
|
||||||
MP_FATAL(config, "\ncan't get memory for 'line': %s", strerror(errno));
|
|
||||||
ret = -1;
|
ret = -1;
|
||||||
goto out;
|
goto out;
|
||||||
} else
|
} else
|
||||||
@ -80,7 +79,7 @@ int m_config_parse_config_file(m_config_t *config, const char *conffile,
|
|||||||
MP_VERBOSE(config, "\n");
|
MP_VERBOSE(config, "\n");
|
||||||
|
|
||||||
if ((fp = fopen(conffile, "r")) == NULL) {
|
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;
|
ret = 0;
|
||||||
goto out;
|
goto out;
|
||||||
}
|
}
|
||||||
@ -114,7 +113,7 @@ int m_config_parse_config_file(m_config_t *config, const char *conffile,
|
|||||||
opt[opt_pos++] = line[line_pos++];
|
opt[opt_pos++] = line[line_pos++];
|
||||||
if (opt_pos >= MAX_OPT_LEN) {
|
if (opt_pos >= MAX_OPT_LEN) {
|
||||||
PRINT_LINENUM;
|
PRINT_LINENUM;
|
||||||
MP_ERR(config, "too long option\n");
|
MP_ERR(config, "option name too long\n");
|
||||||
errors++;
|
errors++;
|
||||||
ret = -1;
|
ret = -1;
|
||||||
goto nextline;
|
goto nextline;
|
||||||
|
Loading…
Reference in New Issue
Block a user