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
5fd7f467
Commit
5fd7f467
authored
Nov 12, 2006
by
Rémi Denis-Courmont
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use stat instead of fopen to check for file existence
parent
8d9bd047
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
4 deletions
+4
-4
src/input/subtitles.c
src/input/subtitles.c
+4
-4
No files found.
src/input/subtitles.c
View file @
5fd7f467
...
...
@@ -43,6 +43,7 @@
#ifdef HAVE_UNISTD_H
# include <unistd.h>
#endif
#include <sys/stat.h>
#include <ctype.h>
#include "input_internal.h"
...
...
@@ -391,17 +392,16 @@ char **subtitles_Detect( input_thread_t *p_this, char *psz_path,
}
if
(
i_prio
>=
fuzzy
.
i_int
)
{
FILE
*
f
;
char
psz_path
[
strlen
(
psz_dir
)
+
strlen
(
psz_name
)
+
1
];
struct
stat
st
;
sprintf
(
psz_path
,
"%s%s"
,
psz_dir
,
psz_name
);
msg_Dbg
(
p_this
,
"autodetected subtitle: %s with priority %d"
,
psz_path
,
i_prio
);
/* FIXME: a portable wrapper for stat() or access() would be more suited */
if
(
(
f
=
utf8_fopen
(
psz_path
,
"rt"
)
)
)
if
(
utf8_stat
(
psz_path
,
&
st
)
&&
S_ISREG
(
st
.
st_mode
)
)
{
fclose
(
f
);
msg_Dbg
(
p_this
,
"autodetected subtitle: %s with priority %d"
,
psz_path
,
i_prio
);
...
...
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