(PS3/UNIX-type FS) Skips '.' and '..' directories from being

included in the dir list when doing dir_list_new
This commit is contained in:
Twinaphex 2012-07-30 00:36:09 +02:00
parent 1be33ff581
commit daff4fb27c
3 changed files with 7 additions and 32 deletions

View File

@ -276,6 +276,9 @@ struct string_list *dir_list_new(const char *dir, const char *ext, bool include_
if (!include_dirs && is_dir)
continue;
if (strcmp(name, ".") == 0 || strcmp(name, "..") == 0)
continue;
if (!is_dir && ext_list && !string_list_find_elem(ext_list, file_ext))
continue;

View File

@ -797,14 +797,7 @@ static void select_file(void)
if (input_st & (1 << RETRO_DEVICE_ID_JOYPAD_B))
{
if(filebrowser_get_current_path_isdir(&tmpBrowser))
{
/*if 'filename' is in fact '..' - then pop back directory instead of
adding '..' to filename path */
if(tmpBrowser.current_dir.ptr == 0)
filebrowser_iterate(&tmpBrowser, FILEBROWSER_ACTION_CANCEL);
else
filebrowser_iterate(&tmpBrowser, FILEBROWSER_ACTION_OK);
}
filebrowser_iterate(&tmpBrowser, FILEBROWSER_ACTION_OK);
else if (path_file_exists(filebrowser_get_current_path(&tmpBrowser)))
{
snprintf(path, sizeof(path), filebrowser_get_current_path(&tmpBrowser));
@ -916,15 +909,7 @@ static void select_directory(void)
else if (input_st & (1 << RETRO_DEVICE_ID_JOYPAD_B))
{
if(filebrowser_get_current_path_isdir(&tmpBrowser))
{
/* if 'filename' is in fact '..' - then pop back directory instead of
* adding '..' to filename path */
if(tmpBrowser.current_dir.ptr == 0)
filebrowser_iterate(&tmpBrowser, FILEBROWSER_ACTION_CANCEL);
else
filebrowser_iterate(&tmpBrowser, FILEBROWSER_ACTION_OK);
}
filebrowser_iterate(&tmpBrowser, FILEBROWSER_ACTION_OK);
}
}
@ -1702,13 +1687,7 @@ static void menu_romselect_iterate(filebrowser_t *filebrowser, menu_romselect_ac
{
case MENU_ROMSELECT_ACTION_OK:
if(filebrowser_get_current_path_isdir(filebrowser))
{
/*if 'filename' is in fact '..' - then pop back directory instead of adding '..' to filename path */
if(browser.current_dir.ptr == 0)
filebrowser_iterate(filebrowser, FILEBROWSER_ACTION_CANCEL);
else
filebrowser_iterate(filebrowser, FILEBROWSER_ACTION_OK);
}
filebrowser_iterate(filebrowser, FILEBROWSER_ACTION_OK);
else
rarch_console_load_game_wrap(filebrowser_get_current_path(filebrowser), g_console.zip_extract_mode, S_DELAY_45);
break;

View File

@ -70,14 +70,7 @@ static void menu_romselect_iterate(filebrowser_t *filebrowser, menu_romselect_ac
{
case MENU_ROMSELECT_ACTION_OK:
if(filebrowser_get_current_path_isdir(filebrowser))
{
/*if 'filename' is in fact '..' - then pop back directory instead of adding '..' to filename path */
//hacky - need to fix this
//if(browser.current_dir.ptr == 0)
// filebrowser_iterate(filebrowser, FILEBROWSER_ACTION_CANCEL);
//else
filebrowser_iterate(filebrowser, FILEBROWSER_ACTION_OK);
}
filebrowser_iterate(filebrowser, FILEBROWSER_ACTION_OK);
else
rarch_console_load_game_wrap(filebrowser_get_current_path(filebrowser), g_console.zip_extract_mode, S_DELAY_45);
break;