diff options
author | wm4 <wm4@nowhere> | 2013-10-14 23:37:58 +0200 |
---|---|---|
committer | wm4 <wm4@nowhere> | 2013-10-14 23:37:58 +0200 |
commit | c7dee24c8cf07193b6780eb06af2fb7270204b3e (patch) | |
tree | 2a1ba84962c01e00a918ec60009746749ac6e60a /mpvcore/parser-cfg.c | |
parent | 8c234045faefbf6bc43659a7954c5df9aaaecad1 (diff) | |
download | mpv-c7dee24c8cf07193b6780eb06af2fb7270204b3e.tar.bz2 mpv-c7dee24c8cf07193b6780eb06af2fb7270204b3e.tar.xz |
parser-cfg: use bstr everywhere after parsing stage
Until now it used both char[] and bstr variants in the same code, which
was nasty. For example, the next commit would have additionally required
using memmove() to remove the prefix from the char[] string.
Diffstat (limited to 'mpvcore/parser-cfg.c')
-rw-r--r-- | mpvcore/parser-cfg.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/mpvcore/parser-cfg.c b/mpvcore/parser-cfg.c index 567638d2f2..7f1f954c85 100644 --- a/mpvcore/parser-cfg.c +++ b/mpvcore/parser-cfg.c @@ -229,7 +229,7 @@ int m_config_parse_config_file(m_config_t *config, const char *conffile, bstr bparam = bstr0(param); if (profile && bstr_equals0(bopt, "profile-desc")) { - m_profile_set_desc(profile, param); + m_profile_set_desc(profile, bparam); goto nextline; } @@ -239,8 +239,8 @@ int m_config_parse_config_file(m_config_t *config, const char *conffile, if (tmp < 0) { PRINT_LINENUM; mp_msg(MSGT_CFGPARSER, MSGL_ERR, - "error parsing option %s=%s: %s\n", - opt, param, m_option_strerror(tmp)); + "error parsing option %.*s=%.*s: %s\n", + BSTR_P(bopt), BSTR_P(bparam), m_option_strerror(tmp)); continue; } @@ -252,7 +252,8 @@ int m_config_parse_config_file(m_config_t *config, const char *conffile, if (tmp < 0) { PRINT_LINENUM; mp_msg(MSGT_CFGPARSER, MSGL_ERR, - "setting option %s='%s' failed.\n", opt, param); + "setting option %.*s='%.*s' failed.\n", + BSTR_P(bopt), BSTR_P(bparam)); continue; /* break */ } |