Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc-gpu
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-gpu
Commits
45915c74
Commit
45915c74
authored
Aug 21, 2007
by
Rémi Denis-Courmont
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix utf8_readdir usage
parent
9b84d144
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
20 additions
and
18 deletions
+20
-18
modules/control/http/util.c
modules/control/http/util.c
+8
-5
modules/demux/mkv.cpp
modules/demux/mkv.cpp
+3
-0
modules/gui/ncurses.c
modules/gui/ncurses.c
+8
-12
src/text/unicode.c
src/text/unicode.c
+1
-1
No files found.
modules/control/http/util.c
View file @
45915c74
...
...
@@ -149,7 +149,7 @@ int E_(ParseDirectory)( intf_thread_t *p_intf, char *psz_root,
msg_Dbg
(
p_intf
,
"dir=%s"
,
psz_dir
);
s
printf
(
dir
,
"%s%c.access"
,
psz_dir
,
sep
);
s
nprintf
(
dir
,
sizeof
(
dir
)
,
"%s%c.access"
,
psz_dir
,
sep
);
if
(
(
file
=
utf8_fopen
(
dir
,
"r"
)
)
!=
NULL
)
{
char
line
[
1024
];
...
...
@@ -183,7 +183,7 @@ int E_(ParseDirectory)( intf_thread_t *p_intf, char *psz_root,
fclose
(
file
);
}
s
printf
(
dir
,
"%s%c.hosts"
,
psz_dir
,
sep
);
s
nprintf
(
dir
,
sizeof
(
dir
)
,
"%s%c.hosts"
,
psz_dir
,
sep
);
p_acl
=
ACL_Create
(
p_intf
,
VLC_FALSE
);
if
(
ACL_LoadFile
(
p_acl
,
dir
)
)
{
...
...
@@ -193,7 +193,7 @@ int E_(ParseDirectory)( intf_thread_t *p_intf, char *psz_root,
for
(
;;
)
{
c
onst
c
har
*
psz_filename
;
char
*
psz_filename
;
/* parse psz_src dir */
if
(
(
psz_filename
=
utf8_readdir
(
p_dir
)
)
==
NULL
)
{
...
...
@@ -202,10 +202,13 @@ int E_(ParseDirectory)( intf_thread_t *p_intf, char *psz_root,
if
(
(
psz_filename
[
0
]
==
'.'
)
||
(
i_dirlen
+
strlen
(
psz_filename
)
>
MAX_DIR_SIZE
)
)
{
free
(
psz_filename
);
continue
;
}
s
printf
(
dir
,
"%s%c%s"
,
psz_dir
,
sep
,
psz_filename
);
free
(
(
char
*
)
psz_filename
);
s
nprintf
(
dir
,
sizeof
(
dir
)
,
"%s%c%s"
,
psz_dir
,
sep
,
psz_filename
);
free
(
psz_filename
);
if
(
E_
(
ParseDirectory
)(
p_intf
,
psz_root
,
dir
)
)
{
...
...
modules/demux/mkv.cpp
View file @
45915c74
...
...
@@ -1532,7 +1532,10 @@ static int Open( vlc_object_t * p_this )
#else
if
(
!
s_filename
.
compare
(
p_demux
->
psz_path
))
#endif
{
free
(
psz_file
);
continue
;
// don't reuse the original opened file
}
#if defined(__GNUC__) && (__GNUC__ < 3)
if
(
!
s_filename
.
compare
(
"mkv"
,
s_filename
.
length
()
-
3
,
3
)
||
...
...
modules/gui/ncurses.c
View file @
45915c74
...
...
@@ -27,12 +27,13 @@
/*****************************************************************************
* Preamble
*****************************************************************************/
#include <vlc/vlc.h>
#include <errno.h>
/* ENOMEM */
#include <time.h>
#include <curses.h>
#include <vlc/vlc.h>
#include <vlc_interface.h>
#include <vlc_vout.h>
#include <vlc_aout.h>
...
...
@@ -1927,11 +1928,8 @@ static void ReadDir( intf_thread_t *p_intf )
p_sys
->
pp_dir_entries
=
NULL
;
p_sys
->
i_dir_entries
=
0
;
/* get the first directory entry */
psz_entry
=
utf8_readdir
(
p_current_dir
);
/* while we still have entries in the directory */
while
(
psz_entry
!=
NULL
)
while
(
(
psz_entry
=
utf8_readdir
(
p_current_dir
)
)
!=
NULL
)
{
#if defined( S_ISDIR )
struct
stat
stat_data
;
...
...
@@ -1946,7 +1944,6 @@ static void ReadDir( intf_thread_t *p_intf )
strcmp
(
psz_entry
,
".."
)
)
{
free
(
psz_entry
);
psz_entry
=
utf8_readdir
(
p_current_dir
);
continue
;
}
...
...
@@ -1955,13 +1952,14 @@ static void ReadDir( intf_thread_t *p_intf )
if
(
!
(
p_dir_entry
=
malloc
(
sizeof
(
struct
dir_entry_t
)
)
)
)
{
free
(
psz_uri
);
return
;
free
(
psz_uri
);
free
(
psz_entry
);
continue
;
}
#if defined( S_ISDIR )
utf8_stat
(
psz_uri
,
&
stat_data
);
if
(
S_ISDIR
(
stat_data
.
st_mode
)
)
if
(
!
utf8_stat
(
psz_uri
,
&
stat_data
)
&&
S_ISDIR
(
stat_data
.
st_mode
)
)
/*#elif defined( DT_DIR )
if( p_dir_content->d_type & DT_DIR )*/
#else
...
...
@@ -1983,8 +1981,6 @@ static void ReadDir( intf_thread_t *p_intf )
free
(
psz_uri
);
free
(
psz_entry
);
/* Read next entry */
psz_entry
=
utf8_readdir
(
p_current_dir
);
}
/* Sort */
...
...
src/text/unicode.c
View file @
45915c74
...
...
@@ -416,7 +416,7 @@ DIR *utf8_opendir( const char *dirname )
*
* @param dir The directory that is being read
*
* @return a UTF-8 string of the directory entry. Use
LocaleFree() to free this memory
* @return a UTF-8 string of the directory entry. Use
free() to free this memory.
*/
char
*
utf8_readdir
(
DIR
*
dir
)
{
...
...
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