Changeset aae60936d25a41b92b4827c2c7b32ee2b3b5266c
- Timestamp:
- 02/04/08 22:43:29
(8 months ago)
- Author:
- Antoine Cellerier <dionoea@videolan.org>
- git-committer:
- Antoine Cellerier <dionoea@videolan.org> 1207169009 +0200
- git-parent:
[4ad218c25fb08d55b944e1c78c20cb96492f6267]
- git-author:
- Antoine Cellerier <dionoea@videolan.org> 1207169009 +0200
- Message:
Simplify code reading.
-
Files:
-
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
| r4ad218c |
raae6093 |
|
| 406 | 406 | char **ppsz_dir_list ) |
|---|
| 407 | 407 | { |
|---|
| 408 | | if( asprintf( &ppsz_dir_list[0], "%s" DIR_SEP "lua" DIR_SEP "%s", |
|---|
| | 408 | int i = 0; |
|---|
| | 409 | if( asprintf( &ppsz_dir_list[i], "%s" DIR_SEP "lua" DIR_SEP "%s", |
|---|
| 409 | 410 | p_this->p_libvlc->psz_datadir, luadirname ) < 0 ) |
|---|
| 410 | 411 | return VLC_ENOMEM; |
|---|
| | 412 | i++; |
|---|
| 411 | 413 | |
|---|
| 412 | 414 | # if defined(__APPLE__) || defined(SYS_BEOS) || defined(WIN32) |
|---|
| 413 | 415 | { |
|---|
| 414 | 416 | const char *psz_vlcpath = config_GetDataDir(); |
|---|
| 415 | | if( asprintf( &ppsz_dir_list[1], "%s" DIR_SEP "lua" DIR_SEP "%s", |
|---|
| | 417 | if( asprintf( &ppsz_dir_list[i], "%s" DIR_SEP "lua" DIR_SEP "%s", |
|---|
| 416 | 418 | psz_vlcpath, luadirname ) < 0 ) |
|---|
| 417 | 419 | return VLC_ENOMEM; |
|---|
| 418 | | |
|---|
| 419 | | if( asprintf( &ppsz_dir_list[2], "%s" DIR_SEP "share" DIR_SEP "lua" DIR_SEP "%s", |
|---|
| | 420 | i++; |
|---|
| | 421 | |
|---|
| | 422 | if( asprintf( &ppsz_dir_list[i], "%s" DIR_SEP "share" DIR_SEP "lua" DIR_SEP "%s", |
|---|
| 420 | 423 | psz_vlcpath, luadirname ) < 0 ) |
|---|
| 421 | 424 | return VLC_ENOMEM; |
|---|
| | 425 | i++; |
|---|
| 422 | 426 | } |
|---|
| 423 | 427 | # else |
|---|
| 424 | | if( asprintf( &ppsz_dir_list[1], |
|---|
| | 428 | if( asprintf( &ppsz_dir_list[i], |
|---|
| 425 | 429 | "share" DIR_SEP "lua" DIR_SEP "%s", luadirname ) < 0 ) |
|---|
| 426 | 430 | return VLC_ENOMEM; |
|---|
| … | … | |
| 429 | 433 | { |
|---|
| 430 | 434 | struct stat stat_info; |
|---|
| 431 | | if( ( utf8_stat( ppsz_dir_list[1], &stat_info ) == -1 ) |
|---|
| | 435 | if( ( utf8_stat( ppsz_dir_list[i], &stat_info ) == -1 ) |
|---|
| 432 | 436 | || !S_ISDIR( stat_info.st_mode ) ) |
|---|
| 433 | 437 | { |
|---|
| 434 | | free(ppsz_dir_list[1]); |
|---|
| 435 | | if( asprintf( &ppsz_dir_list[1], "%s" DIR_SEP "lua" DIR_SEP "%s", |
|---|
| | 438 | free(ppsz_dir_list[i]); |
|---|
| | 439 | if( asprintf( &ppsz_dir_list[i], "%s" DIR_SEP "lua" DIR_SEP "%s", |
|---|
| 436 | 440 | config_GetDataDir (), luadirname ) < 0 ) |
|---|
| 437 | 441 | return VLC_ENOMEM; |
|---|
| … | … | |
| 439 | 443 | } |
|---|
| 440 | 444 | # endif |
|---|
| | 445 | i++; |
|---|
| 441 | 446 | # endif |
|---|
| 442 | 447 | return VLC_SUCCESS; |
|---|