[MPlayer-cvslog] r25323 - trunk/libmenu/menu_filesel.c

Benjamin Zores ben at geexbox.org
Sat Dec 8 17:39:41 CET 2007


ben a écrit :
> Author: ben
> Date: Sat Dec  8 17:27:25 2007
> New Revision: 25323
> 
> Log:
> rework of libmenu open_dir()
> 
> Modified:
>    trunk/libmenu/menu_filesel.c
> 
> Modified: trunk/libmenu/menu_filesel.c
> ==============================================================================
> --- trunk/libmenu/menu_filesel.c	(original)
> +++ trunk/libmenu/menu_filesel.c	Sat Dec  8 17:27:25 2007
> @@ -180,7 +180,7 @@ static void free_extensions(char **exten
>    }
>  }
>  
> -static int open_dir(menu_t* menu,char* args) {
> +static int _open_dir(menu_t* menu,char* args) {
>    char **namelist, **tp;
>    struct dirent *dp;
>    struct stat st;
> @@ -291,7 +291,13 @@ bailout:
>  
>    return 1;
>  }
> -    
> +static int open_dir(menu_t* menu,char* args) {
> +  if (_open_dir(menu, args))
> +    return 1;
> +  if (menu_chroot && _open_dir(menu, menu_chroot))
> +    return 1;
> +  return 0;
> +}

Simple use case for those who wonder about this patch:

- use libmenu file selection to go to some network share
- browse files
- network shares suddenly become unavailable
- next time you'll hit "..", you'll be in directory defined as 
"menu-chroot" one (if defined). Without this patch, you'll get stuck
in a twilight zone ;-)

Ben



More information about the MPlayer-cvslog mailing list