From: Antoine Cellerier Date: Wed, 30 Dec 2009 15:08:29 +0000 (+0100) Subject: C has a function named strchr(). X-Git-Tag: 1.1.0-ff~1596 X-Git-Url: https://git.sesse.net/?a=commitdiff_plain;h=8e3df82b7c1cf1ba08fbaf15f46af8b741781647;p=vlc C has a function named strchr(). --- diff --git a/src/modules/modules.c b/src/modules/modules.c index 52662a2c20..cdd26307aa 100644 --- a/src/modules/modules.c +++ b/src/modules/modules.c @@ -437,16 +437,13 @@ module_t * __module_need( vlc_object_t *p_this, const char *psz_capability, } i_shortcuts++; - psz_shortcuts = psz_last_shortcut = strdup( psz_name ); + psz_parser = psz_shortcuts = psz_last_shortcut = strdup( psz_name ); - for( psz_parser = psz_shortcuts; *psz_parser; psz_parser++ ) + while( ( psz_parser = strchr( psz_parser, ',' ) ) ) { - if( *psz_parser == ',' ) - { - *psz_parser = '\0'; - i_shortcuts++; - psz_last_shortcut = psz_parser + 1; - } + *psz_parser = '\0'; + i_shortcuts++; + psz_last_shortcut = ++psz_parser; } /* Check if the user wants to override the "strict" mode */