]> git.sesse.net Git - vlc/commitdiff
Fix the interpretation of command "help" by VLM.
authorAdrien Grand <jpountz@jpountz.net>
Sun, 27 Apr 2008 13:17:03 +0000 (15:17 +0200)
committerPierre d'Herbemont <pdherbemont@videolan.org>
Tue, 29 Apr 2008 12:42:35 +0000 (14:42 +0200)
In the function ExecuteCommand, p_message is given in argument to ExecuteHelp
and is then modified locally in ExecuteHelp:
  p_message = vlm_MessageNew( "help", vlm_NULL );
whereas it is used further in function ExecuteCommand.
This patch fixes this problem by passing the pointer address in argument to
ExecuteHelp instead of the pointer itself.

Signed-off-by: Pierre d'Herbemont <pdherbemont@videolan.org>
src/input/vlm.c

index 598476650827e9cf3fbb8c237d16124baabfc2e0..b53a021acbfe039df1226f0a68af28ee75c46c2d 100644 (file)
@@ -420,16 +420,16 @@ static int ExecuteShow( vlm_t *p_vlm, const char *psz_name, vlm_message_t **pp_s
     return VLC_SUCCESS;
 }
 
-static int ExecuteHelp( vlm_message_t *p_status )
+static int ExecuteHelp( vlm_message_t **pp_status )
 {
     vlm_message_t *message_child;
 
 #define MessageAdd( a ) \
-        vlm_MessageAdd( p_status, vlm_MessageNew( a, vlm_NULL ) );
+        vlm_MessageAdd( *pp_status, vlm_MessageNew( a, vlm_NULL ) );
 #define MessageAddChild( a ) \
         vlm_MessageAdd( message_child, vlm_MessageNew( a, vlm_NULL ) );
 
-    p_status = vlm_MessageNew( "help", vlm_NULL );
+    *pp_status = vlm_MessageNew( "help", vlm_NULL );
 
     message_child = MessageAdd( "Commands Syntax:" );
     MessageAddChild( "new (name) vod|broadcast|schedule [properties]" );
@@ -1043,7 +1043,7 @@ static int ExecuteCommand( vlm_t *p_vlm, const char *psz_command,
     }
     else IF_EXECUTE( "del",     (i_command != 2),   ExecuteDel(p_vlm, ppsz_command[1], &p_message) )
     else IF_EXECUTE( "show",    (i_command > 2),    ExecuteShow(p_vlm, i_command > 1 ? ppsz_command[1] : NULL, &p_message) )
-    else IF_EXECUTE( "help",    (i_command != 1),   ExecuteHelp( p_message) )
+    else IF_EXECUTE( "help",    (i_command != 1),   ExecuteHelp( &p_message ) )
     else IF_EXECUTE( "control", (i_command < 3),    ExecuteControl(p_vlm, ppsz_command[1], i_command - 2, &ppsz_command[2], &p_message) )
     else IF_EXECUTE( "save",    (i_command != 2),   ExecuteSave(p_vlm, ppsz_command[1], &p_message) )
     else IF_EXECUTE( "export",  (i_command != 1),   ExecuteExport(p_vlm, &p_message) )