Commit 089821fb authored by Rémi Duraffort's avatar Rémi Duraffort

zsh: fix infinite loop.

parent bdaad357
...@@ -224,30 +224,32 @@ void ParseOption( module_config_t *p_item, mumap &mods, mcmap &mods2 ) ...@@ -224,30 +224,32 @@ void ParseOption( module_config_t *p_item, mumap &mods, mcmap &mods2 )
{ {
std::pair<mumap::iterator, mumap::iterator> range = mods.equal_range( p_item->psz_type ); std::pair<mumap::iterator, mumap::iterator> range = mods.equal_range( p_item->psz_type );
std::string list = (*range.first).second; std::string list = (*range.first).second;
++range.first; if( range.first != range.second )
while( range.first != range.second ) {
while( range.first++ != range.second )
{ {
list = list.append( " " ); list = list.append( " " );
list = list.append( range.first->second ); list = list.append( range.first->second );
++range.first;
} }
asprintf( &psz_arguments, "(%s)", list.c_str() ); asprintf( &psz_arguments, "(%s)", list.c_str() );
} }
}
break; break;
case CONFIG_ITEM_MODULE_CAT: case CONFIG_ITEM_MODULE_CAT:
{ {
std::pair<mcmap::iterator, mcmap::iterator> range = std::pair<mcmap::iterator, mcmap::iterator> range =
mods2.equal_range( p_item->min.i ); mods2.equal_range( p_item->min.i );
std::string list = (*range.first).second; std::string list = (*range.first).second;
++range.first; if( range.first != range.second )
while( range.first != range.second ) {
while( range.first++ != range.second )
{ {
list = list.append( " " ); list = list.append( " " );
list = list.append( range.first->second ); list = list.append( range.first->second );
++range.first;
} }
asprintf( &psz_arguments, "(%s)", list.c_str() ); asprintf( &psz_arguments, "(%s)", list.c_str() );
} }
}
break; break;
case CONFIG_ITEM_MODULE_LIST_CAT: case CONFIG_ITEM_MODULE_LIST_CAT:
{ {
......
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