Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc-1.1
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-1.1
Commits
f45d4512
Commit
f45d4512
authored
Feb 06, 2010
by
Rémi Denis-Courmont
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
LUA: fopen/fclose -> stat
parent
1a14e109
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
4 deletions
+7
-4
modules/misc/lua/intf.c
modules/misc/lua/intf.c
+7
-4
No files found.
modules/misc/lua/intf.c
View file @
f45d4512
...
...
@@ -39,6 +39,8 @@
#include <vlc_interface.h>
#include <vlc_playlist.h>
#include <vlc_aout.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <lua.h>
/* Low level lua C API */
#include <lauxlib.h>
/* Higher level C API */
...
...
@@ -65,17 +67,18 @@ static char *FindFile( vlc_object_t *p_this, const char *psz_name )
for
(
ppsz_dir
=
ppsz_dir_list
;
*
ppsz_dir
;
ppsz_dir
++
)
{
char
*
psz_filename
;
FILE
*
fp
;
struct
stat
st
;
if
(
asprintf
(
&
psz_filename
,
"%s"
DIR_SEP
"%s.lua"
,
*
ppsz_dir
,
psz_name
)
<
0
)
{
vlclua_dir_list_free
(
ppsz_dir_list
);
return
NULL
;
}
fp
=
fopen
(
psz_filename
,
"r"
);
if
(
fp
)
if
(
utf8_stat
(
psz_filename
,
&
st
)
==
0
&&
S_ISREG
(
st
.
st_mode
)
)
{
fclose
(
fp
);
vlclua_dir_list_free
(
ppsz_dir_list
);
return
psz_filename
;
}
...
...
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