[vlc-devel] commit: ncurses: make file browser open files ( Rafaël Carré )

git version control git at videolan.org
Wed Aug 19 00:58:39 CEST 2009


vlc | branch: 1.0-bugfix | Rafaël Carré <rafael.carre at gmail.com> | Wed Aug 19 00:54:41 2009 +0200| [83431bd8449e318d9eb6c54d05056a8e63df4172] | committer: Rafaël Carré 

ncurses: make file browser open files

all files would be opened as directories

Pointed-out-by: cachereturn on #videolan
(cherry picked from commit 9b1ce0e8f3ba760e3453084933c3bf9a3f8c62b2)

Signed-off-by: Rafaël Carré <rafael.carre at gmail.com>

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=83431bd8449e318d9eb6c54d05056a8e63df4172
---

 modules/gui/ncurses.c |    9 ++++++++-
 1 files changed, 8 insertions(+), 1 deletions(-)

diff --git a/modules/gui/ncurses.c b/modules/gui/ncurses.c
index 7091715..2e81599 100644
--- a/modules/gui/ncurses.c
+++ b/modules/gui/ncurses.c
@@ -764,8 +764,15 @@ static int HandleKey( intf_thread_t *p_intf, int i_key )
                 if( p_sys->pp_dir_entries[p_sys->i_box_bidx]->b_file || i_key == ' ' )
                 {
                     char* psz_uri;
-                    if( asprintf( &psz_uri, "directory://%s/%s", p_sys->psz_current_dir, p_sys->pp_dir_entries[p_sys->i_box_bidx]->psz_path ) == -1 )
+                    if( asprintf( &psz_uri, "%s://%s/%s",
+                        p_sys->pp_dir_entries[p_sys->i_box_bidx]->b_file ?
+                            "file" : "directory",
+                        p_sys->psz_current_dir,
+                        p_sys->pp_dir_entries[p_sys->i_box_bidx]->psz_path
+                        ) == -1 )
+                    {
                         psz_uri = NULL;
+                    }
 
                     playlist_item_t *p_parent = p_sys->p_node;
                     if( !p_parent )




More information about the vlc-devel mailing list