Changeset 0df4f0cd18ac6ac174a53459447999e62a59190c
- Timestamp:
- 08/16/07 18:48:05
(1 year ago)
- Author:
- Damien Fouilleul <damienf@videolan.org>
- git-committer:
- Damien Fouilleul <damienf@videolan.org> 1187282885 +0000
- git-parent:
[2dffeb14fb0b1cd571aace3cde1c9c8dcc48eb64]
- git-author:
- Damien Fouilleul <damienf@videolan.org> 1187282885 +0000
- Message:
lua: fixed search paths list for scripts, needs more work for Linux
-
Files:
-
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
| r515deca |
r0df4f0c |
|
| 253 | 253 | char **ppsz_file; |
|---|
| 254 | 254 | |
|---|
| 255 | | char *ppsz_dir_list[] = { NULL, NULL, NULL }; |
|---|
| | 255 | char *ppsz_dir_list[] = { NULL, NULL, NULL, NULL }; |
|---|
| 256 | 256 | char **ppsz_dir; |
|---|
| 257 | 257 | |
|---|
| … | … | |
| 290 | 290 | lua_pop( p_state, 1 ); |
|---|
| 291 | 291 | |
|---|
| 292 | | ppsz_dir_list[0] = malloc( strlen( p_demux->p_libvlc->psz_homedir ) |
|---|
| 293 | | + strlen( DIR_SEP CONFIG_DIR DIR_SEP "luaplaylist" ) + 1 ); |
|---|
| 294 | | sprintf( ppsz_dir_list[0], "%s" DIR_SEP CONFIG_DIR DIR_SEP "luaplaylist", |
|---|
| 295 | | p_demux->p_libvlc->psz_homedir ); |
|---|
| | 292 | if( asprintf( &ppsz_dir_list[0], "%s" DIR_SEP CONFIG_DIR DIR_SEP "luaplaylist", |
|---|
| | 293 | p_demux->p_libvlc->psz_homedir ) < -1 ) |
|---|
| | 294 | return VLC_ENOMEM; |
|---|
| 296 | 295 | |
|---|
| 297 | 296 | # if defined(__APPLE__) || defined(SYS_BEOS) || defined(WIN32) |
|---|
| 298 | 297 | { |
|---|
| 299 | 298 | char *psz_vlcpath = config_GetDataDir( p_demux ); |
|---|
| 300 | | ppsz_dir_list[1] = malloc( strlen( psz_vlcpath ) + strlen( "luaplaylist" ) + 1 ); |
|---|
| 301 | | if( !ppsz_dir_list[1] ) return VLC_ENOMEM; |
|---|
| 302 | | sprintf( ppsz_dir_list[1], "%s" DIR_SEP "luaplaylist", psz_vlcpath ); |
|---|
| | 299 | if( asprintf( &ppsz_dir_list[1], "%s" DIR_SEP "luaplaylist", psz_vlcpath ) < 0 ) |
|---|
| | 300 | return VLC_ENOMEM; |
|---|
| | 301 | if( asprintf( &ppsz_dir_list[2], "%s" DIR_SEP "share" DIR_SEP "luaplaylist", psz_vlcpath ) < 0 ) |
|---|
| | 302 | return VLC_ENOMEM; |
|---|
| 303 | 303 | } |
|---|
| 304 | 304 | # else |
|---|
| … | … | |
| 348 | 348 | { |
|---|
| 349 | 349 | free( psz_filename ); psz_filename = NULL; |
|---|
| 350 | | asprintf( &psz_filename, "%s/%s", *ppsz_dir, *ppsz_file ); |
|---|
| | 350 | asprintf( &psz_filename, "%s" DIR_SEP "%s", *ppsz_dir, *ppsz_file ); |
|---|
| 351 | 351 | msg_Dbg( p_demux, "Trying Lua playlist script %s", psz_filename ); |
|---|
| 352 | 352 | p_demux->p_sys->psz_filename = psz_filename; |
|---|
| r515deca |
r0df4f0c |
|
| 293 | 293 | char **ppsz_file; |
|---|
| 294 | 294 | |
|---|
| 295 | | char *ppsz_dir_list[] = { NULL, NULL, NULL }; |
|---|
| | 295 | char *ppsz_dir_list[] = { NULL, NULL, NULL, NULL }; |
|---|
| 296 | 296 | char **ppsz_dir; |
|---|
| 297 | 297 | |
|---|
| 298 | | ppsz_dir_list[0] = malloc( strlen( p_this->p_libvlc->psz_homedir ) |
|---|
| 299 | | + strlen( DIR_SEP CONFIG_DIR DIR_SEP ) + strlen( luadirname ) + 1 ); |
|---|
| 300 | | sprintf( ppsz_dir_list[0], "%s" DIR_SEP CONFIG_DIR DIR_SEP "%s", |
|---|
| 301 | | p_this->p_libvlc->psz_homedir, luadirname ); |
|---|
| | 298 | if( asprintf( &ppsz_dir_list[0], "%s" DIR_SEP CONFIG_DIR DIR_SEP "%s", p_this->p_libvlc->psz_homedir, |
|---|
| | 299 | luadirname ) < 0 ) |
|---|
| | 300 | return VLC_ENOMEM; |
|---|
| 302 | 301 | |
|---|
| 303 | 302 | # if defined(__APPLE__) || defined(SYS_BEOS) || defined(WIN32) |
|---|
| 304 | 303 | { |
|---|
| 305 | 304 | const char *psz_vlcpath = config_GetDataDir( p_this ); |
|---|
| 306 | | ppsz_dir_list[1] = malloc( strlen( psz_vlcpath ) + strlen( luadirname ) + 1 ); |
|---|
| 307 | | if( !ppsz_dir_list[1] ) return VLC_ENOMEM; |
|---|
| 308 | | sprintf( ppsz_dir_list[1], "%s" DIR_SEP "%s", psz_vlcpath, luadirname ); |
|---|
| | 305 | if( asprintf( &ppsz_dir_list[1], "%s" DIR_SEP "%s", psz_vlcpath, luadirname ) < 0 ) |
|---|
| | 306 | return VLC_ENOMEM; |
|---|
| | 307 | |
|---|
| | 308 | if( asprintf( &ppsz_dir_list[2], "%s" DIR_SEP "share" DIR_SEP "%s", psz_vlcpath, luadirname ) < 0 ) |
|---|
| | 309 | return VLC_ENOMEM; |
|---|
| 309 | 310 | } |
|---|
| 310 | 311 | # endif |
|---|