Changeset 48a985ecd756e3969c4b55998f24e281f03c1536
- Timestamp:
- 05/10/08 19:46:18
(6 days ago)
- Author:
- Rémi Denis-Courmont <rem@videolan.org>
- git-committer:
- Rémi Denis-Courmont <rem@videolan.org> 1210441578 +0300
- git-parent:
[492c2c6822d71bf82076188cd21898b3ee2c9981]
- git-author:
- Rémi Denis-Courmont <rem@videolan.org> 1210441571 +0300
- Message:
Don't look for plugins from CWD. Also don't leak in case of errors.
-
Files:
-
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
| r1eea47c |
r48a985e |
|
| 904 | 904 | static void AllocateAllPlugins( vlc_object_t *p_this ) |
|---|
| 905 | 905 | { |
|---|
| | 906 | const char *vlcpath = vlc_global()->psz_vlcpath; |
|---|
| 906 | 907 | int count,i; |
|---|
| 907 | 908 | char * path; |
|---|
| … | … | |
| 910 | 911 | /* Contruct the special search path for system that have a relocatable |
|---|
| 911 | 912 | * executable. Set it to <vlc path>/modules and <vlc path>/plugins. */ |
|---|
| 912 | | #define RETURN_ENOMEM \ |
|---|
| 913 | | { \ |
|---|
| 914 | | msg_Err( p_this, "Not enough memory" ); \ |
|---|
| 915 | | return; \ |
|---|
| 916 | | } |
|---|
| 917 | | |
|---|
| 918 | | vlc_array_append( arraypaths, strdup( "modules" ) ); |
|---|
| 919 | | #if defined( WIN32 ) || defined( UNDER_CE ) || defined( __APPLE__ ) || defined( SYS_BEOS ) |
|---|
| 920 | | if( asprintf( &path, "%s" DIR_SEP "modules", |
|---|
| 921 | | vlc_global()->psz_vlcpath ) < 0 ) |
|---|
| 922 | | RETURN_ENOMEM |
|---|
| 923 | | vlc_array_append( arraypaths, path ); |
|---|
| 924 | | if( asprintf( &path, "%s" DIR_SEP "plugins", |
|---|
| 925 | | vlc_global()->psz_vlcpath ) < 0 ) |
|---|
| 926 | | RETURN_ENOMEM |
|---|
| 927 | | vlc_array_append( arraypaths, path ); |
|---|
| 928 | | #if ! defined( WIN32 ) && ! defined( UNDER_CE ) |
|---|
| 929 | | if( asprintf( &path, "%s", PLUGIN_PATH ) < 0 ) |
|---|
| 930 | | RETURN_ENOMEM |
|---|
| 931 | | vlc_array_append( arraypaths, path ); |
|---|
| 932 | | #endif |
|---|
| 933 | | #else |
|---|
| | 913 | |
|---|
| | 914 | if( vlcpath && asprintf( &path, "%s" DIR_SEP "modules", vlcpath ) != -1 ) |
|---|
| | 915 | vlc_array_append( arraypaths, path ); |
|---|
| | 916 | if( vlcpath && asprintf( &path, "%s" DIR_SEP "plugins", vlcpath ) != -1 ) |
|---|
| | 917 | vlc_array_append( arraypaths, path ); |
|---|
| | 918 | #ifndef WIN32 |
|---|
| 934 | 919 | vlc_array_append( arraypaths, strdup( PLUGIN_PATH ) ); |
|---|
| 935 | 920 | #endif |
|---|
| 936 | | vlc_array_append( arraypaths, strdup( "plugins" ) ); |
|---|
| 937 | 921 | |
|---|
| 938 | 922 | /* If the user provided a plugin path, we add it to the list */ |
|---|
| … | … | |
| 943 | 927 | { |
|---|
| 944 | 928 | path = copy_next_paths_token( paths_iter, &paths_iter ); |
|---|
| 945 | | if( !path ) |
|---|
| 946 | | RETURN_ENOMEM |
|---|
| 947 | | vlc_array_append( arraypaths, strdup( path ) ); |
|---|
| | 929 | if( path ) |
|---|
| | 930 | vlc_array_append( arraypaths, strdup( path ) ); |
|---|
| 948 | 931 | } |
|---|
| 949 | 932 | |
|---|
| … | … | |
| 953 | 936 | path = vlc_array_item_at_index( arraypaths, i ); |
|---|
| 954 | 937 | if( !path ) |
|---|
| 955 | | { |
|---|
| 956 | 938 | continue; |
|---|
| 957 | | } |
|---|
| 958 | 939 | |
|---|
| 959 | 940 | msg_Dbg( p_this, "recursively browsing `%s'", path ); |
|---|
| … | … | |
| 966 | 947 | |
|---|
| 967 | 948 | vlc_array_destroy( arraypaths ); |
|---|
| 968 | | #undef RETURN_ENOMEM |
|---|
| 969 | 949 | } |
|---|
| 970 | 950 | |
|---|