]> git.sesse.net Git - vlc/commitdiff
C has a function named strchr().
authorAntoine Cellerier <dionoea@videolan.org>
Wed, 30 Dec 2009 15:08:29 +0000 (16:08 +0100)
committerAntoine Cellerier <dionoea@videolan.org>
Wed, 30 Dec 2009 15:09:46 +0000 (16:09 +0100)
src/modules/modules.c

index 52662a2c200e162de8f478eb7ef1fa51ca2521ee..cdd26307aab60cf005d9ce4005ff2952c4b1ec61 100644 (file)
@@ -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 */