Commit 2fcddc86 authored by Fabio Ritrovato's avatar Fabio Ritrovato

Lua SD: fix for scripts without a description and ".luac" files

parent ab399a4d
...@@ -602,17 +602,39 @@ static int vlc_sd_probe_Open( vlc_object_t *obj ) ...@@ -602,17 +602,39 @@ static int vlc_sd_probe_Open( vlc_object_t *obj )
char *temp = strchr( description, '\n' ); char *temp = strchr( description, '\n' );
if( temp ) if( temp )
*temp = '\0'; *temp = '\0';
*(*ppsz_file + strlen(*ppsz_file) - 4 )= '\0'; temp = strchr( *ppsz_file, '.' );
if( temp )
*temp = '\0';
char *psz_longname;
if( !strncmp( description, "--SD_Description=", 17 ) )
{
if( !( psz_longname = strdup( description + 17 ) ) )
{
fclose( fd );
free( psz_filename );
goto error;
}
}
else
{
if( !( psz_longname = strdup( *ppsz_file ) ) )
{
fclose( fd );
free( psz_filename );
goto error;
}
}
if( asprintf( &psz_name, "lua{sd=%s,longname=%s}", if( asprintf( &psz_name, "lua{sd=%s,longname=%s}",
*ppsz_file, description + 17 ) < 0 ) *ppsz_file, psz_longname ) < 0 )
{ {
fclose( fd ); fclose( fd );
free( psz_filename ); free( psz_filename );
free( psz_longname );
goto error; goto error;
} }
vlc_sd_probe_Add( probe, psz_name, vlc_sd_probe_Add( probe, psz_name, psz_longname );
description + 17 );
free( psz_name ); free( psz_name );
free( psz_longname );
} }
fclose( fd ); fclose( fd );
} }
......
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