diff options
author | Uoti Urpala <uau@mplayer2.org> | 2011-07-28 11:07:47 +0300 |
---|---|---|
committer | Uoti Urpala <uau@mplayer2.org> | 2011-07-29 05:50:38 +0300 |
commit | e873d703e956d3e2e68b9e18562983b029b5c7a8 (patch) | |
tree | 44a2c48ae4e94bd580ffd5833cd71a037af36043 /libmenu | |
parent | d8374376c0d46ffab88b96eb32b52621c34f562c (diff) | |
download | mpv-e873d703e956d3e2e68b9e18562983b029b5c7a8.tar.bz2 mpv-e873d703e956d3e2e68b9e18562983b029b5c7a8.tar.xz |
options: change option parsing to use bstr
Using bstr allows simpler parsing code, especially because it avoids
the need to modify or copy strings just to terminate extracted
substrings.
Diffstat (limited to 'libmenu')
-rw-r--r-- | libmenu/menu.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/libmenu/menu.c b/libmenu/menu.c index 0f920825b0..3e003900ce 100644 --- a/libmenu/menu.c +++ b/libmenu/menu.c @@ -208,7 +208,8 @@ static int menu_parse_config(char* buffer, struct m_config *mconfig) // Setup the attribs for(i = 0 ; attribs[2*i] ; i++) { if(strcasecmp(attribs[2*i],"name") == 0) continue; - if(!m_struct_set(&minfo->priv_st,menu_list[menu_count].cfg,attribs[2*i], attribs[2*i+1])) + if (!m_struct_set(&minfo->priv_st, menu_list[menu_count].cfg, + attribs[2*i], bstr(attribs[2*i+1]))) mp_tmsg(MSGT_GLOBAL,MSGL_WARN,"[MENU] bad attribute %s=%s in menu '%s' at line %d\n",attribs[2*i],attribs[2*i+1], name,parser->line); } |