[vlc-devel] commit: C has a function named strchr(). (Antoine Cellerier )

git version control git at videolan.org
Wed Dec 30 16:10:40 CET 2009


vlc | branch: master | Antoine Cellerier <dionoea at videolan.org> | Wed Dec 30 16:08:29 2009 +0100| [8e3df82b7c1cf1ba08fbaf15f46af8b741781647] | committer: Antoine Cellerier 

C has a function named strchr().

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=8e3df82b7c1cf1ba08fbaf15f46af8b741781647
---

 src/modules/modules.c |   13 +++++--------
 1 files changed, 5 insertions(+), 8 deletions(-)

diff --git a/src/modules/modules.c b/src/modules/modules.c
index 52662a2..cdd2630 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 */




More information about the vlc-devel mailing list