Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc-2-2
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Redmine
Redmine
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Metrics
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
videolan
vlc-2-2
Commits
48a985ec
Commit
48a985ec
authored
May 10, 2008
by
Rémi Denis-Courmont
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Don't look for plugins from CWD. Also don't leak in case of errors.
parent
492c2c68
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
28 deletions
+8
-28
src/modules/modules.c
src/modules/modules.c
+8
-28
No files found.
src/modules/modules.c
View file @
48a985ec
...
@@ -903,37 +903,21 @@ static char * copy_next_paths_token( char * paths, char ** remaining_paths )
...
@@ -903,37 +903,21 @@ static char * copy_next_paths_token( char * paths, char ** remaining_paths )
#ifdef HAVE_DYNAMIC_PLUGINS
#ifdef HAVE_DYNAMIC_PLUGINS
static
void
AllocateAllPlugins
(
vlc_object_t
*
p_this
)
static
void
AllocateAllPlugins
(
vlc_object_t
*
p_this
)
{
{
const
char
*
vlcpath
=
vlc_global
()
->
psz_vlcpath
;
int
count
,
i
;
int
count
,
i
;
char
*
path
;
char
*
path
;
vlc_array_t
*
arraypaths
=
vlc_array_new
();
vlc_array_t
*
arraypaths
=
vlc_array_new
();
/* Contruct the special search path for system that have a relocatable
/* Contruct the special search path for system that have a relocatable
* executable. Set it to <vlc path>/modules and <vlc path>/plugins. */
* executable. Set it to <vlc path>/modules and <vlc path>/plugins. */
#define RETURN_ENOMEM \
{ \
msg_Err( p_this, "Not enough memory" ); \
return; \
}
vlc_array_append
(
arraypaths
,
strdup
(
"modules"
)
);
if
(
vlcpath
&&
asprintf
(
&
path
,
"%s"
DIR_SEP
"modules"
,
vlcpath
)
!=
-
1
)
#if defined( WIN32 ) || defined( UNDER_CE ) || defined( __APPLE__ ) || defined( SYS_BEOS )
vlc_array_append
(
arraypaths
,
path
);
if
(
asprintf
(
&
path
,
"%s"
DIR_SEP
"modules"
,
if
(
vlcpath
&&
asprintf
(
&
path
,
"%s"
DIR_SEP
"plugins"
,
vlcpath
)
!=
-
1
)
vlc_global
()
->
psz_vlcpath
)
<
0
)
vlc_array_append
(
arraypaths
,
path
);
RETURN_ENOMEM
#ifndef WIN32
vlc_array_append
(
arraypaths
,
path
);
if
(
asprintf
(
&
path
,
"%s"
DIR_SEP
"plugins"
,
vlc_global
()
->
psz_vlcpath
)
<
0
)
RETURN_ENOMEM
vlc_array_append
(
arraypaths
,
path
);
#if ! defined( WIN32 ) && ! defined( UNDER_CE )
if
(
asprintf
(
&
path
,
"%s"
,
PLUGIN_PATH
)
<
0
)
RETURN_ENOMEM
vlc_array_append
(
arraypaths
,
path
);
#endif
#else
vlc_array_append
(
arraypaths
,
strdup
(
PLUGIN_PATH
)
);
vlc_array_append
(
arraypaths
,
strdup
(
PLUGIN_PATH
)
);
#endif
#endif
vlc_array_append
(
arraypaths
,
strdup
(
"plugins"
)
);
/* If the user provided a plugin path, we add it to the list */
/* If the user provided a plugin path, we add it to the list */
char
*
userpaths
=
config_GetPsz
(
p_this
,
"plugin-path"
);
char
*
userpaths
=
config_GetPsz
(
p_this
,
"plugin-path"
);
...
@@ -942,9 +926,8 @@ static void AllocateAllPlugins( vlc_object_t *p_this )
...
@@ -942,9 +926,8 @@ static void AllocateAllPlugins( vlc_object_t *p_this )
for
(
paths_iter
=
userpaths
;
paths_iter
;
)
for
(
paths_iter
=
userpaths
;
paths_iter
;
)
{
{
path
=
copy_next_paths_token
(
paths_iter
,
&
paths_iter
);
path
=
copy_next_paths_token
(
paths_iter
,
&
paths_iter
);
if
(
!
path
)
if
(
path
)
RETURN_ENOMEM
vlc_array_append
(
arraypaths
,
strdup
(
path
)
);
vlc_array_append
(
arraypaths
,
strdup
(
path
)
);
}
}
count
=
vlc_array_count
(
arraypaths
);
count
=
vlc_array_count
(
arraypaths
);
...
@@ -952,9 +935,7 @@ static void AllocateAllPlugins( vlc_object_t *p_this )
...
@@ -952,9 +935,7 @@ static void AllocateAllPlugins( vlc_object_t *p_this )
{
{
path
=
vlc_array_item_at_index
(
arraypaths
,
i
);
path
=
vlc_array_item_at_index
(
arraypaths
,
i
);
if
(
!
path
)
if
(
!
path
)
{
continue
;
continue
;
}
msg_Dbg
(
p_this
,
"recursively browsing `%s'"
,
path
);
msg_Dbg
(
p_this
,
"recursively browsing `%s'"
,
path
);
...
@@ -965,7 +946,6 @@ static void AllocateAllPlugins( vlc_object_t *p_this )
...
@@ -965,7 +946,6 @@ static void AllocateAllPlugins( vlc_object_t *p_this )
}
}
vlc_array_destroy
(
arraypaths
);
vlc_array_destroy
(
arraypaths
);
#undef RETURN_ENOMEM
}
}
/*****************************************************************************
/*****************************************************************************
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment