Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc
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
Commits
7b98e85b
Commit
7b98e85b
authored
May 20, 2008
by
Rémi Denis-Courmont
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Don't use stat() before opendir()
parent
ce0b5da9
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
11 deletions
+7
-11
modules/control/http/mvar.c
modules/control/http/mvar.c
+7
-11
No files found.
modules/control/http/mvar.c
View file @
7b98e85b
...
...
@@ -503,20 +503,12 @@ mvar_t *mvar_FileSetNew( intf_thread_t *p_intf, char *name,
char
*
psz_dir
)
{
mvar_t
*
s
=
mvar_New
(
name
,
"set"
);
#ifdef HAVE_SYS_STAT_H
struct
stat
stat_info
;
#endif
char
**
ppsz_dir_content
;
int
i_dir_content
,
i
;
psz_dir
=
RealPath
(
p_intf
,
psz_dir
);
#ifdef HAVE_SYS_STAT_H
if
(
(
utf8_stat
(
psz_dir
,
&
stat_info
)
==
-
1
)
||
!
S_ISDIR
(
stat_info
.
st_mode
)
# if defined( WIN32 )
&&
psz_dir
[
0
]
!=
'\0'
&&
(
psz_dir
[
0
]
!=
'\\'
||
psz_dir
[
1
]
!=
'\0'
)
# endif
)
#if defined( WIN32 )
if
(
psz_dir
[
0
]
!=
'\0'
&&
(
psz_dir
[
0
]
!=
'\\'
||
psz_dir
[
1
]
!=
'\0'
)
)
{
free
(
psz_dir
);
return
s
;
...
...
@@ -527,13 +519,17 @@ mvar_t *mvar_FileSetNew( intf_thread_t *p_intf, char *name,
if
(
(
i_dir_content
=
utf8_scandir
(
psz_dir
,
&
ppsz_dir_content
,
Filter
,
InsensitiveAlphasort
)
)
==
-
1
)
{
msg_Warn
(
p_intf
,
"error while scanning dir %s (%m)"
,
psz_dir
);
if
(
errno
!=
ENOENT
&&
errno
!=
ENOTDIR
)
msg_Warn
(
p_intf
,
"error while scanning dir %s (%m)"
,
psz_dir
);
free
(
psz_dir
);
return
s
;
}
for
(
i
=
0
;
i
<
i_dir_content
;
i
++
)
{
#ifdef HAVE_SYS_STAT_H
struct
stat
stat_info
;
#endif
char
*
psz_name
=
ppsz_dir_content
[
i
],
*
psz_ext
,
*
psz_dummy
;
char
psz_tmp
[
strlen
(
psz_dir
)
+
1
+
strlen
(
psz_name
)
+
1
];
mvar_t
*
f
;
...
...
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