Commit 27892180 authored by Rafaël Carré's avatar Rafaël Carré Committed by Rémi Duraffort

fix zsh completion

add needed header to fix build
process all config items
process all items of config lists (off by one)
fix display of lists: some option have a space in their name
(cherry picked from commit faa09ff6)
Modified-by: default avatarRémi Duraffort <ivoire@videolan.org>
Signed-off-by: default avatarRémi Duraffort <ivoire@videolan.org>
parent 37ac16e0
......@@ -145,7 +145,7 @@ void ParseModules( mumap &mods, mcmap &mods2 )
if( p_item->i_type & CONFIG_ITEM )
ParseOption( p_item, mods, mods2 );
}
while( i_items++ < p_module->i_config_items && p_item++ );
while( ++i_items < p_module->confsize && p_item++ );
}
module_list_free( p_list );
......@@ -268,7 +268,7 @@ void ParseOption( module_config_t *p_item, mumap &mods, mcmap &mods2 )
int i = p_item->i_list -1;
char *psz_list;
if( p_item->ppsz_list_text )
asprintf( &psz_list, "%s\\:%s", p_item->ppsz_list[i],
asprintf( &psz_list, "%s\\:\\\"%s\\\"", p_item->ppsz_list[i],
p_item->ppsz_list_text[i] );
else
psz_list = strdup(p_item->ppsz_list[i]);
......@@ -276,10 +276,10 @@ void ParseOption( module_config_t *p_item, mumap &mods, mcmap &mods2 )
while( i>1 )
{
if( p_item->ppsz_list_text )
asprintf( &psz_list2, "%s\\:%s %s", p_item->ppsz_list[i-1],
asprintf( &psz_list2, "%s\\:\\\"%s\\\" %s", p_item->ppsz_list[i-1],
p_item->ppsz_list_text[i-1], psz_list );
else
asprintf( &psz_list2, "%s %s", p_item->ppsz_list[i-1],
asprintf( &psz_list2, "\\\"%s\\\" %s", p_item->ppsz_list[i-1],
psz_list );
free( psz_list );
......@@ -308,18 +308,18 @@ void ParseOption( module_config_t *p_item, mumap &mods, mcmap &mods2 )
int i = p_item->i_list -1;
char *psz_list;
if( p_item->ppsz_list_text )
asprintf( &psz_list, "%d\\:%s", p_item->pi_list[i],
asprintf( &psz_list, "%d\\:\\\"%s\\\"", p_item->pi_list[i],
p_item->ppsz_list_text[i] );
else
psz_list = strdup(p_item->ppsz_list[i]);
char *psz_list2;
while( i>1 )
while( i > 0 )
{
if( p_item->ppsz_list_text )
asprintf( &psz_list2, "%d\\:%s %s", p_item->pi_list[i-1],
asprintf( &psz_list2, "%d\\:\\\"%s\\\" %s", p_item->pi_list[i-1],
p_item->ppsz_list_text[i-1], psz_list );
else
asprintf( &psz_list2, "%s %s", p_item->ppsz_list[i-1],
asprintf( &psz_list2, "\\\"%s\\\" %s", p_item->ppsz_list[i-1],
psz_list );
free( psz_list );
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment