Commit b942bf2b authored by Adrien Grand's avatar Adrien Grand Committed by Pierre d'Herbemont

Fix the interpretation of command "help" by VLM.

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: default avatarPierre d'Herbemont <pdherbemont@videolan.org>
parent 58b76176
......@@ -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) )
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment