[vlc-devel] commit: Fix the interpretation of command "help" by VLM. (Adrien Grand )
git version control
git at videolan.org
Tue Apr 29 15:15:23 CEST 2008
vlc | branch: master | Adrien Grand <jpountz at jpountz.net> | Sun Apr 27 15:17:03 2008 +0200| [b942bf2b1bf1f9ca9b9ca951937ab947d42b376a]
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: Pierre d'Herbemont <pdherbemont at videolan.org>
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=b942bf2b1bf1f9ca9b9ca951937ab947d42b376a
---
src/input/vlm.c | 8 ++++----
1 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/src/input/vlm.c b/src/input/vlm.c
index 5984766..b53a021 100644
--- a/src/input/vlm.c
+++ b/src/input/vlm.c
@@ -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) )
More information about the vlc-devel
mailing list