[vlc-devel] commit: zsh: fix infinite loop. ( Rémi Duraffort )
git version control
git at videolan.org
Mon Jan 4 10:38:59 CET 2010
vlc | branch: master | Rémi Duraffort <ivoire at videolan.org> | Mon Jan 4 10:21:01 2010 +0100| [089821fb58411044200fbf228e127b01b74a3361] | committer: Rémi Duraffort
zsh: fix infinite loop.
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=089821fb58411044200fbf228e127b01b74a3361
---
extras/analyser/zsh.cpp | 26 ++++++++++++++------------
1 files changed, 14 insertions(+), 12 deletions(-)
diff --git a/extras/analyser/zsh.cpp b/extras/analyser/zsh.cpp
index 7eb2bf2..249f812 100644
--- a/extras/analyser/zsh.cpp
+++ b/extras/analyser/zsh.cpp
@@ -224,14 +224,15 @@ 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::string list = (*range.first).second;
- ++range.first;
- while( range.first != range.second )
+ if( range.first != range.second )
{
- list = list.append( " " );
- list = list.append( range.first->second );
- ++range.first;
+ while( range.first++ != range.second )
+ {
+ list = list.append( " " );
+ list = list.append( range.first->second );
+ }
+ asprintf( &psz_arguments, "(%s)", list.c_str() );
}
- asprintf( &psz_arguments, "(%s)", list.c_str() );
}
break;
case CONFIG_ITEM_MODULE_CAT:
@@ -239,14 +240,15 @@ void ParseOption( module_config_t *p_item, mumap &mods, mcmap &mods2 )
std::pair<mcmap::iterator, mcmap::iterator> range =
mods2.equal_range( p_item->min.i );
std::string list = (*range.first).second;
- ++range.first;
- while( range.first != range.second )
+ if( range.first != range.second )
{
- list = list.append( " " );
- list = list.append( range.first->second );
- ++range.first;
+ while( range.first++ != range.second )
+ {
+ list = list.append( " " );
+ list = list.append( range.first->second );
+ }
+ asprintf( &psz_arguments, "(%s)", list.c_str() );
}
- asprintf( &psz_arguments, "(%s)", list.c_str() );
}
break;
case CONFIG_ITEM_MODULE_LIST_CAT:
More information about the vlc-devel
mailing list