Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc-2-2
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Redmine
Redmine
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Metrics
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
videolan
vlc-2-2
Commits
d1371735
Commit
d1371735
authored
Jan 27, 2011
by
Pierre Ynard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ncurses: fix URI creation
This fixes opening of file names containing non-ASCII characters
parent
d2dbed4c
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
17 deletions
+14
-17
modules/gui/ncurses.c
modules/gui/ncurses.c
+14
-17
No files found.
modules/gui/ncurses.c
View file @
d1371735
...
...
@@ -51,6 +51,7 @@
#include <vlc_playlist.h>
#include <vlc_meta.h>
#include <vlc_fs.h>
#include <vlc_url.h>
#include <assert.h>
...
...
@@ -258,7 +259,7 @@ static bool IsFile(const char *current_dir, const char *entry)
char
*
uri
;
struct
stat
st
;
if
(
asprintf
(
&
uri
,
"%s
/
%s"
,
current_dir
,
entry
)
!=
-
1
)
if
(
asprintf
(
&
uri
,
"%s
"
DIR_SEP
"
%s"
,
current_dir
,
entry
)
!=
-
1
)
{
ret
=
vlc_stat
(
uri
,
&
st
)
||
!
S_ISDIR
(
st
.
st_mode
);
free
(
uri
);
...
...
@@ -1439,31 +1440,27 @@ static bool HandleBrowseKey(intf_thread_t *p_intf, int key)
case
'\n'
:
case
' '
:
dir_entry
=
p_sys
->
pp_dir_entries
[
p_sys
->
i_box_idx
];
char
*
psz_path
;
if
(
asprintf
(
&
psz_path
,
"%s"
DIR_SEP
"%s"
,
p_sys
->
psz_current_dir
,
dir_entry
->
psz_path
)
==
-
1
)
return
true
;
if
(
!
dir_entry
->
b_file
&&
key
!=
' '
)
{
char
*
current_dir
=
p_sys
->
psz_current_dir
;
if
(
asprintf
(
&
p_sys
->
psz_current_dir
,
"%s/%s"
,
p_sys
->
psz_current_dir
,
dir_entry
->
psz_path
)
!=
-
1
)
{
ReadDir
(
p_intf
);
free
(
current_dir
);
}
else
p_sys
->
psz_current_dir
=
current_dir
;
free
(
p_sys
->
psz_current_dir
);
p_sys
->
psz_current_dir
=
psz_path
;
ReadDir
(
p_intf
);
p_sys
->
i_box_start
=
0
;
p_sys
->
i_box_idx
=
0
;
return
true
;
}
char
*
psz_uri
;
if
(
asprintf
(
&
psz_uri
,
"%s://%s/%s"
,
dir_entry
->
b_file
?
"file"
:
"directory"
,
p_sys
->
psz_current_dir
,
dir_entry
->
psz_path
)
==
-
1
)
{
return
false
;
}
char
*
psz_uri
=
make_URI
(
psz_path
,
dir_entry
->
b_file
?
"file"
:
"directory"
);
free
(
psz_path
);
if
(
psz_uri
==
NULL
)
return
true
;
playlist_t
*
p_playlist
=
pl_Get
(
p_intf
);
playlist_item_t
*
p_parent
=
p_sys
->
p_node
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment