Commit 1b75ee7b authored by Felix Paul Kühne's avatar Felix Paul Kühne

* don't use nested functions please. --- fixes compilation on OSX, which was broken in [17281]

parent ff6d1b16
...@@ -365,44 +365,45 @@ LIBVLC_VLM_GET_MEDIA_ATTRIBUTE( seekable, int, Bool, 0); ...@@ -365,44 +365,45 @@ LIBVLC_VLM_GET_MEDIA_ATTRIBUTE( seekable, int, Bool, 0);
#undef LIBVLC_VLM_GET_MEDIA_ATTRIBUTE #undef LIBVLC_VLM_GET_MEDIA_ATTRIBUTE
char* libvlc_vlm_show_media( libvlc_instance_t *p_instance, char *psz_name, /* local function to be used in libvlc_vlm_show_media only */
libvlc_exception_t *p_exception ) char* recurse_answer( char* psz_prefix, vlm_message_t *p_answer ) {
{ char* psz_childprefix;
char* recurse_answer( char* psz_prefix, vlm_message_t *p_answer ) { char* psz_response="";
char* psz_childprefix; char* response_tmp;
char* psz_response=""; int i;
char* response_tmp; vlm_message_t *aw_child, **paw_child;
int i;
vlm_message_t *aw_child, **paw_child; asprintf( &psz_childprefix, "%s%s.", psz_prefix, p_answer->psz_name );
asprintf( &psz_childprefix, "%s%s.", psz_prefix, p_answer->psz_name ); if ( p_answer->i_child )
{
if ( p_answer->i_child ) paw_child = p_answer->child;
aw_child = *( paw_child );
for( i = 0; i < p_answer->i_child; i++ )
{ {
paw_child = p_answer->child; asprintf( &response_tmp, "%s%s%s:%s\n",
aw_child = *( paw_child ); psz_response, psz_prefix, aw_child->psz_name,
for( i = 0; i < p_answer->i_child; i++ ) aw_child->psz_value );
free( psz_response );
psz_response = response_tmp;
if ( aw_child->i_child )
{ {
asprintf( &response_tmp, "%s%s%s:%s\n", asprintf(&response_tmp, "%s%s", psz_response,
psz_response, psz_prefix, aw_child->psz_name, recurse_answer(psz_childprefix, aw_child));
aw_child->psz_value );
free( psz_response ); free( psz_response );
psz_response = response_tmp; psz_response = response_tmp;
if ( aw_child->i_child )
{
asprintf(&response_tmp, "%s%s", psz_response,
recurse_answer(psz_childprefix, aw_child));
free( psz_response );
psz_response = response_tmp;
}
paw_child++;
aw_child = *( paw_child );
} }
paw_child++;
aw_child = *( paw_child );
} }
free( psz_childprefix );
return psz_response;
} }
free( psz_childprefix );
return psz_response;
}
char* libvlc_vlm_show_media( libvlc_instance_t *p_instance, char *psz_name,
libvlc_exception_t *p_exception )
{
char *psz_message; char *psz_message;
vlm_message_t *answer; vlm_message_t *answer;
char *psz_response; char *psz_response;
......
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