Changeset 07b2e364addba87a4f304d3a3dfd2db79103e76e
- Timestamp:
- 10/11/06 21:10:23
(2 years ago)
- Author:
- Rémi Denis-Courmont <rem@videolan.org>
- git-committer:
- Rémi Denis-Courmont <rem@videolan.org> 1163189423 +0000
- git-parent:
[497a6b5b58f15feeb8340c392b7aec0bc9818f6e]
- git-author:
- Rémi Denis-Courmont <rem@videolan.org> 1163189423 +0000
- Message:
Code factorization and some warning fixes
-
Files:
-
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
| r415749b |
r07b2e36 |
|
| 75 | 75 | "expand: all subdirectories are expanded.\n" ) |
|---|
| 76 | 76 | |
|---|
| 77 | | static char *psz_recursive_list[] = { "none", "collapse", "expand" }; |
|---|
| 78 | | static char *psz_recursive_list_text[] = { N_("none"), N_("collapse"), |
|---|
| 79 | | N_("expand") }; |
|---|
| | 77 | static const char *psz_recursive_list[] = { "none", "collapse", "expand" }; |
|---|
| | 78 | static const char *psz_recursive_list_text[] = { N_("none"), N_("collapse"), |
|---|
| | 79 | N_("expand") }; |
|---|
| 80 | 80 | |
|---|
| 81 | 81 | #define IGNORE_TEXT N_("Ignored extensions") |
|---|
| … | … | |
| 135 | 135 | access_t *p_access = (access_t*)p_this; |
|---|
| 136 | 136 | |
|---|
| | 137 | struct stat stat_info; |
|---|
| | 138 | |
|---|
| 137 | 139 | #ifdef HAVE_SYS_STAT_H |
|---|
| 138 | | struct stat stat_info; |
|---|
| 139 | | char *psz_path = ToLocale( p_access->psz_path ); |
|---|
| 140 | | |
|---|
| 141 | | if( ( stat( psz_path, &stat_info ) == -1 ) || |
|---|
| 142 | | !S_ISDIR( stat_info.st_mode ) ) |
|---|
| 143 | | #elif defined(WIN32) |
|---|
| 144 | | int i_ret; |
|---|
| 145 | | |
|---|
| 146 | | # ifdef UNICODE |
|---|
| 147 | | wchar_t psz_path[MAX_PATH]; |
|---|
| 148 | | mbstowcs( psz_path, p_access->psz_path, MAX_PATH ); |
|---|
| 149 | | psz_path[MAX_PATH-1] = 0; |
|---|
| 150 | | # else |
|---|
| 151 | | char *psz_path = p_access->psz_path; |
|---|
| 152 | | # endif /* UNICODE */ |
|---|
| 153 | | |
|---|
| 154 | | i_ret = GetFileAttributes( psz_path ); |
|---|
| 155 | | if( i_ret == -1 || !(i_ret & FILE_ATTRIBUTE_DIRECTORY) ) |
|---|
| 156 | | |
|---|
| | 140 | if (utf8_stat (p_access->psz_path, &stat_info) |
|---|
| | 141 | || !S_ISDIR (stat_info.st_mode)) |
|---|
| 157 | 142 | #else |
|---|
| 158 | 143 | if( strcmp( p_access->psz_access, "dir") && |
|---|
| 159 | 144 | strcmp( p_access->psz_access, "directory") ) |
|---|
| 160 | 145 | #endif |
|---|
| 161 | | { |
|---|
| 162 | | LocaleFree( psz_path ); |
|---|
| 163 | 146 | return VLC_EGENERIC; |
|---|
| 164 | | } |
|---|
| 165 | | |
|---|
| 166 | | LocaleFree( psz_path ); |
|---|
| | 147 | |
|---|
| 167 | 148 | p_access->pf_read = Read; |
|---|
| 168 | 149 | p_access->pf_block = NULL; |
|---|