]> git.sesse.net Git - vlc/commitdiff
* consider tabs as white spaces when parsing vlm command line
authorAntoine Cellerier <dionoea@videolan.org>
Tue, 16 Nov 2004 01:14:23 +0000 (01:14 +0000)
committerAntoine Cellerier <dionoea@videolan.org>
Tue, 16 Nov 2004 01:14:23 +0000 (01:14 +0000)
 * all lines where first non white space char is a # is a comment

src/misc/vlm.c

index f70434a0a5f1a5b8c2467dc62b7dbf11e149309d..c815e67fa7e8e722e21827537b649bd9ef67b919 100644 (file)
@@ -252,7 +252,7 @@ static int ExecuteCommand(vlm_t *vlm, char *command, vlm_message_t **p_message)
     while( *cmd != '\0' )
     {
 
-        if( *cmd == ' ' )
+        if( *cmd == ' ' || *cmd == '\t' )
         {
             cmd++;
         }
@@ -261,6 +261,13 @@ static int ExecuteCommand(vlm_t *vlm, char *command, vlm_message_t **p_message)
             char *p_temp;
             int   i_temp;
 
+            /* support for comments */
+            if( i_command == 0 && *cmd == '#')
+            {
+                message = vlm_MessageNew( "", NULL );
+                goto success;
+            }
+
             p_temp = FindEndCommand( cmd );
 
             if( p_temp == NULL ) goto error;
@@ -273,6 +280,7 @@ static int ExecuteCommand(vlm_t *vlm, char *command, vlm_message_t **p_message)
             p_command[ i_command ][ i_temp ] = '\0';
 
             i_command++;
+
             cmd = p_temp;
         }
     }